How to retrieve record links associated with a record on webhook call

Hi,

You’ve recently launched Navigate through record links.

  • Can I get this information of a record on webbook call?
  • Or Should I do an API call something like this or any better way to do it from the webbook listener.

Hi,

you cannot get this information DIRECTLY as the payload of the webhook, sorry.

The API call you linked is perfectly valid and does the job. You could also use the following (undocumented) API call, which is the one we’re using for that new feature you highlighted:

curl 'https://site-api.datocms.com/items/<ITEM_ID>/references?version=published-or-current' \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Api-Version: 3' \
  -H 'Authorization: Bearer <TOKEN>'

the version parameter can be:

  • current: returns all records that in their latest revision have a link to the record
  • published: returns all records that in their published revision have a link to the record
  • current-or-published: returns all records that either in their latest or currently published revision have a link to the record.

The API call is undocumented because it might slightly change in the future.

1 Like

JS api also working as well. Thanks.

Can you please add filters, at least filter[type]?