fabiogomez28

Members
  • Content Count

    7
  • Joined

  • Last visited

  • Days Won

    1

fabiogomez28 last won the day on July 5 2014

fabiogomez28 had the most liked content!

About fabiogomez28

  • Rank
    Newbie

Recent Profile Visitors

220 profile views
  1. the json curl -X PUT -H "Content-Type: application/json" -d {"status":"closed"} https://api.mercadolibre.com/items/MCO412987935?access_token=APP_USR-8258745735804998-102713-83ee952739b76cde58821007a69663ee__F_H__-169677066
  2. Hola. estoy tratando de actualizar un item con un usuario de prueba pero el servidor retorna la siguiente respuesta Array ( [body] => stdClass Object ( [message] => Cannot update item MCO412955280 [status:payment_required, has_bids:false] [error] => validation_error [status] => 400 [cause] => Array ( [0] => stdClass Object ( => item.status.not_modifiable [message] => status is not modifiable. ) ) ) [httpCode] => 400)
  3. estoy enviando el siguiente post para publicar un item $item = array( "title" => "Property title", "category_id" => "MCO1468", "price" => 1000000, "currency_id" => "COP", "available_quantity" => 1, "buying_mode" => "classified", "listing_type_id" => "silver", "condition" => "not_specified", "pictures" => array(array( 'id'=>'', "source" => "http://upload.wikimedia.org/wikipedia/commons/thumb/a/af/WhiteHouseSouthFacade.JPG/800px-WhiteHouseSouthFacade.JPG" )), "seller_contact" => array( "contact" => "Fabio gomez guzman", "other_info" => "other info", "area_code" => "011", "phone" => "4444-5555", "area_code2" => "1234", "phone2" => "4454344", "email" => "test_user_401069@testuser.com", "webmail" => "desarrollo@dynamicweb.co" ), "attributes" => array( array( "ID" => "MCO1459-MTRS", "value_name" => "300" ), array( "ID" => "MCO1459-ANTIG", "value_name" => "60" ), array( "ID" => "MCO1459-BATHQTY", "value_id" => "MCO1459-BATHQTY-4" ), array( "ID" => "MCO1459-HABPISO", "value_id" => "MCO1459-HABPISO-4" ), array( "ID" => "MCO1459-MTRSTOTAL", "value_id" => "300" ), array( "ID" => "MCO1466-VALUEADMIN", "value_name" => "100000" ), array( "ID" => "MCO1459-ESTRATO", "value_id" => "MCO1459-ESTRATO-4" ), ), "location" => array( "address_line" => "Cra 29 a # 49 a 31", "zip_code" => "01234567", "neighborhood" => array( "ID" => "TUNPQjNERTQ2MDYyOA" ), "latitude" => -34.48755, "longitude" => -58.56987, ), ); pero estoy teniendo dos errores 1. no me reconoce el "location" a pesar de que envio el barrio con su respectivo id https://api.mercadolibre.com/classified_locations/neighborhoods/TUNPQjNERTQ2MDYyOA y me retorna el siguiente error de validación: Field 'location' requires up to city level. [country.name: null, state.name: null, city.name: null] 2. no me reconoce los atributos que envió en el tag "attributes" y me dice que no le estoy enviando los atributos obligatorios The attributes [MCO1459-MTRS, MCO1459-ANTIG, MCO1459-BATHQTY, MCO1459-HABPISO] are required for category MCO1468. Check the attribute is present in the attributes list or in all variation attributes combination. Array ( [body] => stdClass Object ( [message] => Validation error [error] => validation_error [status] => 400 [cause] => Array ( [0] => stdClass Object ( => item.attributes.missing_required [message] => The attributes [MCO1459-MTRS, MCO1459-ANTIG, MCO1459-BATHQTY, MCO1459-HABPISO] are required for category MCO1468. Check the attribute is present in the attributes list or in all variation attributes combination. ) [1] => stdClass Object ( [code] => item.attributes.invalid [message] => The attributes [null, null, null, null, null, null, null] are invalid for category MCO1468 ) [2] => stdClass Object ( [code] => item.location.invalid [message] => Field 'location' requires up to city level. [country.name: null, state.name: null, city.name: null] ) [3] => stdClass Object ( [code] => nullable [message] => Property [attributeId] cannot be null ) [4] => stdClass Object ( [code] => nullable [message] => Property [attributeId] cannot be null ) [5] => stdClass Object ( [code] => nullable [message] => Property [attributeId] cannot be null ) [6] => stdClass Object ( [code] => nullable [message] => Property [attributeId] cannot be null ) [7] => stdClass Object ( [code] => nullable [message] => Property [attributeId] cannot be null ) [8] => stdClass Object ( [code] => nullable [message] => Property [attributeId] cannot be null ) [9] => stdClass Object ( [code] => nullable [message] => Property [attributeId] cannot be null ) ) ) [httpCode] => 400 )
  4. Hi in the PHP example the picture property of array is like "pictures" => array( "ID" => "MLA2096545948_102011", "source" => "http://media.point2.com/p2a/htmltext/f2a4/590f/3627/f49be256595a86c91457/original.jpg" ), but the correct form is like "pictures" => array( array( "ID" => "MLA2096545948_102011", "source" => "http://media.point2.com/p2a/htmltext/f2a4/590f/3627/f49be256595a86c91457/original.jpg" ) ), the informartion of picture is a array into other array
  5. for best practises you only add CURLOPT_SSLVERSION => 3 to array $CURL_OPTS like this public static $CURL_OPTS = array( CURLOPT_USERAGENT => "MELI-PHP-SDK-1.0.0", CURLOPT_SSL_VERIFYPEER => false, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_RETURNTRANSFER => 1, CURLOPT_TIMEOUT => 60, CURLOPT_SSLVERSION => 3 );
  6. hi . I had the problem with authentication when requesting the access token. the server returned me Array ( [access_token] => [expires_in] => 1402341901 [refresh_token] => ) I am using PHP SDK and the parameter APP_ID,SECRET_KEY ,REDIRECT_URI were well ,i think the problem was in the curl configuration,i decide print the error in the function execute of mail.php using curl_error public function execute($path, $opts = array(), $params = array()) { $uri = $this->make_path($path, $params); $ch = curl_init($uri); curl_setopt_array($ch, self::$CURL_OPTS); if(!empty($opts)) curl_setopt_array($ch, $opts); $response = curl_exec($ch); //print error $error = curl_error($ch); echo $error; print_r($response); $return["body"] = json_decode($response); $return["httpCode"] = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $return; } this return me Unknown SSL protocol error in connection to api.mercadolibre.com:443 Array searching on google I found the solution, there to add the option curl_setopt($ch, CURLOPT_SSLVERSION, 3) and it worked. SOLVED.