An embed shows content from another site, such as a YouTube video, inline in rich text. Basecamp embeds URLs from the providers it knows, the same ones its editor offers to embed when you paste a link.
Endpoints:
POST /embeds.jsoncreates an embed for a URL, or returns the one that already exists for it.
Required parameters: url of the content to embed.
This endpoint will return 200 OK with the embed's sgid in the JSON representation, whether the embed is new or Basecamp already had one for the URL. A new embed's status is pending while Basecamp asks the provider about it; get the embed about once a second until its status is active, or not_found when the provider has nothing to embed. An active embed has its content_type.
A URL no provider embeds answers 422 Unprocessable Entity with an error; link to it instead. Creating more than 100 new embeds in an hour answers 429 Too Many Requests with an error. Unlike other rate limits, it has no Retry-After: it refuses only new embeds, for the rest of the hour, so don't hold back other requests. Asking for an embed Basecamp already has still works.
{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"status": "pending",
"sgid": "BAh7BkkiC19yYWlscwY6BkVUewdJIglkYXRhBjsAVEkiKmdpZDovL2JjMy9FbWJlZC8xMDMwMDk3NTAyP2V4cGlyZXNfaW4GOwBUSSIIcHVyBjsAVEkiD2F0dGFjaGFibGUGOwBU--10dcfa365b396dfbb686898681ccecb3c96dea3f"
}curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
-d '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}' \
https://3.basecampapi.com/$ACCOUNT_ID/embeds.jsonGET /embeds/$SGID.jsonwill return the embed with thesgidthat creating it returned.
{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"status": "active",
"sgid": "BAh7BkkiC19yYWlscwY6BkVUewdJIglkYXRhBjsAVEkiKmdpZDovL2JjMy9FbWJlZC8xMDMwMDk3NTAyP2V4cGlyZXNfaW4GOwBUSSIIcHVyBjsAVEkiD2F0dGFjaGFibGUGOwBU--10dcfa365b396dfbb686898681ccecb3c96dea3f",
"type": "video",
"content_type": "embed/youtube-video",
"image_url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
"content": ""
}curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://3.basecampapi.com/$ACCOUNT_ID/embeds/$SGID.jsonCheck Inserting an embed for details on how to do this.