Rodrigo Soares Leite

Members
  • Content Count

    2
  • Joined

  • Last visited

About Rodrigo Soares Leite

  • Rank
    Newbie

Recent Profile Visitors

187 profile views
  1. Ola amigo, obrigado pela atenção, segue o json para validar, na verdade eu peguei do próprio retorno do ML esse json, eu mudei o código, como exemplo a seguir. // aqui eu retorno meu item var p = new RestSharp.Parameter(); p.Name = "access_token"; p.Value = m.AccessToken; var ps = new List<RestSharp.Parameter>(); ps.Add(p); IRestResponse prod = m.Get("items/MLB723125884"); // se pego o meu json e Deserializo Object obj = JsonConvert.DeserializeObject(prod.Content); IRestResponse r = m.Post("/items", ps, obj); retorna o seguinte erro: {"message":"No signature of method: static syi.api.validators.ItemFieldsValidator.getRequiredPostFields() is applicable for argument types: (org.codehaus.groovy.grails.web.json.JSONArray, java.util.LinkedHashMap) values: [[[[]], [[]], [[]], [[]], [[]], [[]], [[]], ...], ...]\nPossible solutions: getRequiredPostFields(java.util.Map), getRequiredPostFields(java.util.Map, java.lang.Object), getRequired_post_fields()","error":"internal_error","status":500,"cause":[]} Se envio para o ML do jeito que veio IRestResponse r = m.Post("/items", ps, prod.Content); Retorna o seguinte erro: {"message":"body.invalid","error":"A body is expected. (B)","status":400,"cause":[]} Se puder ajudar eu agradeço muito. // json de retorno do ML {"id":"MLB723125884","site_id":"MLB","title":"Farol Auxiliar Fortluz Celta 06/ Prisma 06/12 Ld Direito","subtitle":null,"seller_id":84465725,"category_id":"MLB47010","official_store_id":null,"price":121.49,"base_price":121.49,"original_price":null,"currency_id":"BRL","initial_quantity":10,"available_quantity":10,"sold_quantity":0,"buying_mode":"buy_it_now","listing_type_id":"gold_special","start_time":"2015-11-16T02:11:55.000Z","stop_time":"2035-11-11T02:11:55.000Z","condition":"new","permalink":"http://produto.mercadolivre.com.br/MLB-723125884-farol-auxiliar-fortluz-celta-06-prisma-0612-ld-direito-_JM","thumbnail":"http://mlb-s1-p.mlstatic.com/832601-MLB20347412827_072015-I.jpg","secure_thumbnail":"https://mlb-s1-p.mlstatic.com/832601-MLB20347412827_072015-I.jpg","pictures":[{"id":"832601-MLB20347412827_072015","url":"http://mlb-s1-p.mlstatic.com/832601-MLB20347412827_072015-O.jpg","secure_url":"https://mlb-s1-p.mlstatic.com/832601-MLB20347412827_072015-O.jpg","size":"500x500","max_size":"500x500","quality":""}],"video_id":null,"descriptions":[{"id":"MLB723125884-968440537"}],"accepts_mercadopago":true,"non_mercado_pago_payment_methods":[{"id":"MLBMO","description":"Dinheiro","type":"G"},{"id":"MLBCC","description":"Cartãode Crédito","type":"N"},{"id":"MLBDE","description":"Depósito Bancário","type":"D"}],"shipping":{"mode":"me2","local_pick_up":false,"free_shipping":false,"methods":[],"dimensions":null,"tags":[]},"international_delivery_mode":"none","seller_address":{"id":116160273,"comment":"","address_line":"","zip_code":"","city":{"id":"BR-SP-44","name":"São Paulo"},"state":{"id":"BR-SP","name":"São Paulo"},"country":{"id":"BR","name":"Brasil"},"latitude":-23.58148203,"longitude":-46.64534951,"search_location":{"neighborhood":{"id":"","name":""},"city":{"id":"","name":""},"state":{"id":"TUxCUFNBT085N2E4","name":"São Paulo"}}},"seller_contact":null,"location":{},"geolocation":{"latitude":-23.58021174,"longitude":-46.64252995},"coverage_areas":[],"attributes":[],"warnings":[],"listing_source":"","variations":[],"status":"active","sub_status":[],"tags":["dragged_bids_and_visits","immediate_payment"],"warranty":null,"catalog_product_id":null,"parent_item_id":"MLB704198874","differential_pricing":null,"deal_ids":[],"automatic_relist":false,"date_created":"2015-11-16T02:11:55.000Z","last_updated":"2015-11-19T22:53:04.000Z"}
  2. Bom dia, por gentileza estou com um problema na hora de inserir um produto usando c# .net, eu já autentiquei estou de posse do Token mas quando utilizo o codigo abaixo, NameValueCollection nc = new NameValueCollection(); nc.Add("access_token", accessToken); nc.Add("client_id", clientId.ToString()); nc.Add("client_secret", consumerSecret); Listhp.Add(nc); //var response1 = meli.Post("/items/", listParameter, jobject1); var response1 = meli.PostAsync("/items/",Listhp, json); response1.Wait(); var rest = response1.Result; Ele retorna badRequest, alguem tem algumas luz, estou com um tempo com esse problema, o retorno do erro é o seguinte. rest; {StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Connection: keep-alive X-API-Name: syi-api X-API-Version: 1.00 Vary: Accept Vary: Accept-Encoding X-Libra-UpstreamHost: 10.32.98.91 X-GAV: master X-Content-Type-Options: nosniff X-Nginx-Host: e-00013de4 X-Nginx-Pool: items-api-webserver-write-master X-Nginx-UpstreamHost: 172.16.38.89:80 X-Request-Id: 174b6fc4-94a6-402c-9fcb-7cb98da3c808 Access-Control-Allow-Origin: * Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS Access-Control-Max-Age: 86400 Cache-Control: max-age=0 Date: Mon, 08 Aug 2016 11:17:36 GMT Content-Type: application/json; charset=UTF-8 }} Content: {System.Net.Http.StreamContent} content: {System.Net.Http.StreamContent} disposed: false Headers: {Connection: keep-alive X-API-Name: syi-api X-API-Version: 1.00 Vary: Accept, Accept-Encoding X-Libra-UpstreamHost: 10.32.98.91 X-GAV: master X-Content-Type-Options: nosniff X-Nginx-Host: e-00013de4 X-Nginx-Pool: items-api-webserver-write-master X-Nginx-UpstreamHost: 172.16.38.89:80 X-Request-Id: 174b6fc4-94a6-402c-9fcb-7cb98da3c808 Access-Control-Allow-Origin: * Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS Access-Control-Max-Age: 86400 Cache-Control: max-age=0 Date: Mon, 08 Aug 2016 11:17:36 GMT } headers: {Connection: keep-alive X-API-Name: syi-api X-API-Version: 1.00 Vary: Accept, Accept-Encoding X-Libra-UpstreamHost: 10.32.98.91 X-GAV: master X-Content-Type-Options: nosniff X-Nginx-Host: e-00013de4 X-Nginx-Pool: items-api-webserver-write-master X-Nginx-UpstreamHost: 172.16.38.89:80 X-Request-Id: 174b6fc4-94a6-402c-9fcb-7cb98da3c808 Access-Control-Allow-Origin: * Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS Access-Control-Max-Age: 86400 Cache-Control: max-age=0 Date: Mon, 08 Aug 2016 11:17:36 GMT } IsSuccessStatusCode: false reasonPhrase: "Bad Request" ReasonPhrase: "Bad Request" requestMessage: {Method: POST, RequestUri: 'https://api.mercadolibre.com/items/?access_token=APP_USR-8818463941876071-080807-9eaa2bc8e4a9cf1d276671efd6723ff2__E_I__-84465725&client_id=8818463941876071&client_secret=lAjr5GErovKdvc2mJvbhjrN1Lk5PicXw&code=TG-57a86a43e4b05ed03dfcd733-84465725&redirect_uri=http://localhost:8085/MercadoLivre'Version: 1.1, Content: System.Net.Http.StringContent, Headers: { User-Agent: MELI-NET-SDK/1.0.6.0 Accept: application/json Content-Type: text/plain; charset=utf-8 Content-Length: 2813 }} RequestMessage: {Method: POST, RequestUri: 'https://api.mercadolibre.com/items/?access_token=APP_USR-8818463941876071-080807-9eaa2bc8e4a9cf1d276671efd6723ff2__E_I__-84465725&client_id=8818463941876071&client_secret=lAjr5GErovKdvc2mJvbhjrN1Lk5PicXw&code=TG-57a86a43e4b05ed03dfcd733-84465725&redirect_uri=http://localhost:8085/MercadoLivre'Version: 1.1, Content: System.Net.Http.StringContent, Headers: { User-Agent: MELI-NET-SDK/1.0.6.0 Accept: application/json Content-Type: text/plain; charset=utf-8 Content-Length: 2813 }} statusCode: BadRequest StatusCode: BadRequest version: {1.1} Version: {1.1}