Adding foreign keys
A foreign key property is a property that maps to another object. For
example, every activity has an assigned user. In the data model, the
Activity
entity has an AssignedUser
field. This is
a foreign key that associated each activity with its assigned user. Similarly, in the
Cloud API Activity
resource, there is an assignedUser
foreign key property.
Restrictions and limitations
You can add foreign key fields to a Cloud API resource if the foreign key entity is any of the following:
- A base configuration entity with a set of CRUD endpoints in the base configuration of Cloud API
- A base configuration entity with a set of CRUD endpoints generated by the REST endpoint generator
- A custom entity with a set of CRUD endpoints generated by the REST endpoint generator
- The foreign key entity is a base configuration entity with no CRUD endpoints.
- The REST endpoint generator does not allow generation of endpoints for that entity.
For example, you cannot add a foreign key field to a resource if the
foreign key points to the Credential
entity. This is because there
are currently no CRUD endpoints in Cloud API for Credential
, and
the REST endpoint generator will not generate endpoints for
Credential
.