POST

Is Referenced Data Item


Checks whether a field in a referring item contains a reference to a specified item.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage All Data Resources
Manage Data Items
Read Data Items
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/wix-data/v2/items/is-referenced

Body Params
dataCollectionIdstringRequired

ID of the collection containing the referring data item.


referringItemFieldNamestringRequired

Field to check for a reference to the item that may be referenced.


referringItemIdstringRequired

ID of the referring item.


referencedItemIdstringRequired

ID of the item that may be referenced.


consistentReadboolean

Whether to retrieve data from the primary database instance. This decreases performance but ensures data retrieved is up to date even immediately after an update. Learn more about Wix Data and eventual consistency.

Default: false

Response Object
isReferencedboolean

Whether the specified reference exists.

Is item referenced
Request
cURL
curl -X POST \ 'https://www.wixapis.com/wix-data/v2/items/is-referenced' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ -d '{ "dataCollectionId": "albums", "referringItemFieldName": "songs", "referringItemId": "37de298e-026d-4b2e-b87f-fbec11d53105", "referencedItemId": "99cb26d5-dd42-4384-af30-3bb6e4026bd0" }'
Response
JSON
{ "isReferenced": true }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?