linked_objects
Creates, updates, deletes, gets or lists a linked_objects resource.
Overview​
| Name | linked_objects |
| Type | Resource |
| Id | okta.users.linked_objects |
Fields​
The following fields are returned by SELECT queries:
- list_linked_objects_for_user
Link objects
| Name | Datatype | Description |
|---|---|---|
_links | object | Specifies 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_linked_objects_for_user | select | userIdOrLogin, relationshipName, subdomain | 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. | |
assign_linked_object_value_for_primary | replace | userIdOrLogin, primaryRelationshipName, primaryUserId, subdomain | 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. | |
delete_linked_object_for_user | delete | userIdOrLogin, relationshipName, subdomain | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
primaryRelationshipName | string | Name of the primary relationship being assigned |
primaryUserId | string | User ID to be assigned to the primary relationship for the associated user |
relationshipName | string | Name of the primary or associated relationship being queried |
subdomain | string | (default: my-org) |
userIdOrLogin | string | If 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​
- list_linked_objects_for_user
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​
- assign_linked_object_value_for_primary
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​
- delete_linked_object_for_user
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
;