Links
Outbound destinations live in a catalogue; artifacts point at entries by id.
There is no writable url field on an artifact. Every outbound destination -- a link on a card, a social profile, a phone number, an email -- is a catalogue entry that artifacts and the site config point at.
| Endpoint | What it does |
|---|---|
| GET /api/v1/site/{site}/urls/ | List catalogue entries, paginated |
| POST /api/v1/site/{site}/urls/ | Create an entry. url is required; label and params optional |
| GET /api/v1/site/{site}/urls/{name}/ | Read one entry |
| POST /api/v1/site/{site}/urls/{name}/ | Update it |
| DELETE /api/v1/site/{site}/urls/{name}/ | Delete it |
Three steps: check whether the entry exists, create it if not, then point something at its id.
Request
curl -X POST -H "Authorization: Token $ENINE_TOKEN" -H "Content-Type: application/json" \
-d '{"url": "https://www.linkedin.com/company/enine", "label": "LinkedIn"}' \
https://e9sites.com/api/v1/site/mysite.e9sites.com/urls/
Response
{"id": 7, "name": "linkedin", "label": "LinkedIn", "url": "https://www.linkedin.com/company/enine", "href": "..."}
Point an item at it:
Request
curl -X POST -H "Authorization: Token $ENINE_TOKEN" -H "Content-Type: application/json" \
-d '{"link": 7}' \
https://e9sites.com/api/v1/site/mysite.e9sites.com/artifacts/web-design/
Or use it as a social icon in the footer:
Request
curl -X POST -H "Authorization: Token $ENINE_TOKEN" -H "Content-Type: application/json" \
-d '{"config": {"social_links": [7, 8]}}' \
https://e9sites.com/api/v1/site/mysite.e9sites.com/configure/
Creating an entry for a URL already in the catalogue returns 409, so list first and reuse the id you find.