Skip to main content

linked_objects

Creates, updates, deletes, gets or lists a linked_objects resource.

Overview​

Namelinked_objects
TypeResource
Idokta.users.linked_objects

Fields​

The following fields are returned by SELECT queries:

Link objects

NameDatatypeDescription
_linksobjectSpecifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_linked_objects_for_userselectuserIdOrLogin, relationshipName, subdomainLists either the self link for the primary user or all associated users in the relationship specified by relationshipName. If the specified user isn't associated in any relationship, an empty array is returned.

Use me instead of id to specify the current session user.
assign_linked_object_value_for_primaryreplaceuserIdOrLogin, primaryRelationshipName, primaryUserId, subdomainAssigns the first user as the associated and the second user as the primary for the specified relationship.

If the first user is already associated with a different primary for this relationship, the previous link is removed. A linked object relationship can specify only one primary user for an associated user.
delete_linked_object_for_userdeleteuserIdOrLogin, relationshipName, subdomainDeletes any existing relationship between the associated and primary user. For the associated user, this is specified by the ID. The primary name specifies the relationship.

The operation is successful if the relationship is deleted. The operation is also successful if the specified user isn't in the associated relationship for any instance of the specified primary and thus, no relationship is found.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
primaryRelationshipNamestringName of the primary relationship being assigned
primaryUserIdstringUser ID to be assigned to the primary relationship for the associated user
relationshipNamestringName of the primary or associated relationship being queried
subdomainstring(default: my-org)
userIdOrLoginstringIf for the self link, this is the ID of the user for whom you want to get the primary user ID. If for the associated relation, this is the user ID or login value of the user assigned the associated relationship. This can be me to represent the current session user.

SELECT examples​

Lists either the self link for the primary user or all associated users in the relationship specified by relationshipName. If the specified user isn't associated in any relationship, an empty array is returned.

Use me instead of id to specify the current session user.

SELECT
_links
FROM okta.users.linked_objects
WHERE userIdOrLogin = '{{ userIdOrLogin }}' -- required
AND relationshipName = '{{ relationshipName }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

REPLACE examples​

Assigns the first user as the associated and the second user as the primary for the specified relationship.

If the first user is already associated with a different primary for this relationship, the previous link is removed. A linked object relationship can specify only one primary user for an associated user.

REPLACE okta.users.linked_objects
SET
-- No updatable properties
WHERE
userIdOrLogin = '{{ userIdOrLogin }}' --required
AND primaryRelationshipName = '{{ primaryRelationshipName }}' --required
AND primaryUserId = '{{ primaryUserId }}' --required
AND subdomain = '{{ subdomain }}' --required;

DELETE examples​

Deletes any existing relationship between the associated and primary user. For the associated user, this is specified by the ID. The primary name specifies the relationship.

The operation is successful if the relationship is deleted. The operation is also successful if the specified user isn't in the associated relationship for any instance of the specified primary and thus, no relationship is found.

DELETE FROM okta.users.linked_objects
WHERE userIdOrLogin = '{{ userIdOrLogin }}' --required
AND relationshipName = '{{ relationshipName }}' --required
AND subdomain = '{{ subdomain }}' --required
;