Post

4 followers Follow
0
Avatar

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?

Dominic Sayers

Please sign in to leave a comment.

4 comments

0
Avatar

If an embed is already attached to an item in an app, can the same embed be attached to a different item in a different app?

What if the other item is in a different workspace?

What are the rules for attaching an embed to an item?

Dominic Sayers 0 votes
0
Avatar

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.

 

Dominic Sayers 0 votes
0
Avatar

Hi Dominic,

You are getting the error because an Embed can only be attached to a single resource at a time. Unfortunately, there is no way of 'transferring' an Embed from one place to another. You will have to create a new one for the second item.

Marc

Marc Høegh 0 votes
0
Avatar

Thanks Marc. I think that could explain what I'm seeing.

If I understand correctly, if I'm syncing a contact with multiple Podio apps then I should store Podio metadata for each app.

Dominic Sayers 0 votes