Update Post

Hello ,
when try to update post I give it the post id but I got ```
{
“status”: “error”,
“message”: “Cast to ObjectId failed for value "1ddfad4d-b31c-4150-8642-a51f92a2c8da" (type string) at path "parentPostId" for model "post"”,
“code”: 500000,
“data”: {}
}

so why this and the post it is that 1ddfad4d-b31c-4150-8642-a51f92a2c8da 

and If I have a post and want to update some filed only, should send all the data of the post again ????

This is cURLs example for update post:

curl --location --request PUT 'https://apix.sg.amity.co/api/v4/posts/65b2e31c4f1d82df7e8af38b' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxx' \
--data '{
  "data": {
    "text": "test5"
  },
  "metadata": {
    "postmetadata":"test5"

  },
  "tags": [
    "test"
  ]
}'

Where did you get the post id from? To further check this, please help share your full cURLs to our support email: support.asc@amity.co

You shouldn’t have to send all data again, you can only send the one you would like to update.

Hello I need to update the metadata only can I make it ?

Hello, certainly, you can. Please see the sample cURLs below:

curl --location --request PUT ‘https://api.eu.amity.co/api/v2/users
–header ‘Content-Type: application/json’
–header ‘Authorization: Bearer xxx’
–data ‘{
“userId”: “Test”,
“metadata”: {
“testmeta”: “usermetaUpdate”
}
}’