Updating an existing embed attachment
I am updating existing Podio items using your API. Sometimes I am re-attaching the same embed to the same item (i.e. nothing is changing, that's just how my code works).
In one app this works just fine, i.e. `PUT https://api.podio.com:443/item/422164319` with a payload of `{"fields": {"link-example": [{"embed": 111814991}]}}` returns an HTTP status of 204: No Content because the embed is already attached to the item.
In another app the equivalent code returns an error, i.e. `PUT https://api.podio.com:443/item/422164319` with a payload of `{"fields":{"link":[{"embed":111108378}]}}` returns an HTTP status of 400: Bad Request with the following message:
```
{
"error_parameters": {}
"error_detail": null
"error_propagate": false
"request": {
"url": "http://api.podio.com/item/422164319"
"query_string": ""
"method": "PUT"
}-
"error_description": "Embed is already attached"
"error": "Embed is already attached"
}
```
Is there some difference between the apps that I can't see? Can I change a setting to make it behave like the first app?
-
When I get the error, it's trying to do something like what follows:
The Podio item already has an embed in that field. Here, for example, is the values array for that field:
```
[{"embed"=>{"embed_id"=>111730353, "embed_html"=>nil, "description"=>nil, "original_url"=>"http://www.ablrate.com", "url"=>"http://www.ablrate.com", "hostname"=>"ablrate.com", "embed_height"=>nil, "resolved_url"=>"http://www.ablrate.com", "title"=>"http://www.ablrate.com", "type"=>"unresolved", "embed_width"=>nil}, "file"=>nil}]
```
I am trying to give it a different embed by supplying a value like this:
```
[{"embed"=>111108381}]
```
111108381 is a valid embed_id.
Please sign in to leave a comment.
Comments
4 comments