• 0
Sign in to follow this  
Ulisses Hen

Como usar filtros nas perguntas no SDK.NET?

Question

Estou usando o seguinte código:

 Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
        Dim p As New Parameter()
        p.Name = "access_token"
        p.Value = m.AccessToken
        Dim ps As New List(Of Parameter)
        ps.Add(p)
        Dim r As IRestResponse = m.Get("/my/received_questions/search", ps)
        Dim rjson = r.Content.ToString
        txtTeste.Text = rjson
end usb

E obtenho:

{
  "total": 928,
  "limit": 50,
  "questions": [
    {
      "date_created": "2015-03-23T14:46:23.000-04:00",
      "item_id": "MLB640208287",
      "seller_id": 108243416,
      "status": "ANSWERED",
      "text": "Aceita uma adega climaticada novinha 16 garrafas tocave ?",
      "id": 3493505092,
      "deleted_from_listing": false,
      "hold": false,
      "answer": {
        "text": "Não amigo, não tenho interesse por esse tipo de equipamento, Obrigado.",
        "status": "ACTIVE",
        "date_created": "2015-03-23T16:45:51.000-04:00"
.........

Porém quando uso filtro dá erro, já tentei:

Dim r As IRestResponse = m.Get("/my/received_questions/search?status=unanswered", ps)
Dim r As IRestResponse = m.Get("/my/received_questions/search?access_token=" & m.AcessToken & "&status=unanswered", ps)

E obtenho geralmente erro de autorização não permitida ou um outro erro

{"message":"You can't access this resource without access token","error":"unauthorized","status":401,"cause":[]} 
{"message":"Invalid status {0}.","error":"invalid_status_search","status":400,"cause":[]} 

Alguém aí sabe onde estou errando?

:

 

 

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Bom como aqui as pessoas não gostam ou não podem ajudar, segue aí a maneira que eu encontrei.

uma vez que parece que a classe do Meli está em conflito com os parâmetros da url.

        Dim webClient As New System.Net.WebClient
        webClient.Encoding = System.Text.Encoding.UTF8
        Dim result As String = webClient.DownloadString("https://api.mercadolibre.com/my/received_questions/search?access_token=" & m.AccessToken.ToString & "&status=unanswered")

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this