• 0
Felipe

Atualizar a descrição

Question

Gostaria de saber como faço para atualizar a descrição com PHP. Estou tentando, mas sempre gera erro:

$id = $_POST['id'];
$descricao = $_POST['descricao'];
        
$desc = array("description" => array("plain_text" => $descricao));

$params = array('access_token' => $_SESSION['access_token']);
$response = $meli->put('/items/'.$id, $desc, $params);

echo  json_encode($response);

O erro gerado é este:

 

  1. body:
    1. message: "Cannot update item MLB119097741 [status:active, has_bids:false]"
    2. error: "validation_error"
    3. status: 400
    4. cause: Array(2)
      1. 0:
        1. department: "items"
        2. cause_id: 265
        3. type: "error"
        4. code: "item.description.not_modifiable"
        5. references: ["description"]
        6. message: "description is not modifiable."
        7. __proto__: Object
      2. 1:
        1. department: "items"
        2. cause_id: 240
        3. type: "error"
        4. code: "field_not_updatable"
        5. references: ["description.plain_text"]
        6. message: "description.plain_text is not modifiable."
        7. __proto__: Object
      3. length: 2
      4. __proto__: Array(0)
    5. __proto__: Object
  2. httpCode: 400
  3. __proto__: Object

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now