Skip to main content

API Usage Flow

Below are the requests that a user needs to make to go through each level of the delegation process, from creating an invite to delegating access. Refer to the Request Attributes table provided to appropriately realize each request.

Create Invite

note

The Wallet Session of the person creating the invite is used in the following call

Request Attributes

ParameterDescriptionSuggested value
wallet_accountThe wallet account id of the wallet user creating the invite linkwallet account id
invite_nameThe given name to the inviterInviter name

Sample Request

curl --location --request POST '{{WS_BASE_URI}}/me/delegate-connection-invitations' \
--header 'Authorization: {{WALLET_SESSION_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"wallet_account": "wallet_account_id",
"invite_name": "Wallet-A"
}'

Sample Response

{
"invite_link": "http://localhost:8084/me/delegate-connection-invitations/invite-response/dfe797bd-2d56-4a46-ab22-d7e5cfd82f18"
}

Accept Invite

note

The Wallet Session must be of the user that did not call Create Invite

Request Attributes

ParameterDescriptionSuggested value
invitationIdThe identifier for the invitationInvitation Id
acceptA true or false value that configures whether to accept invitation or notBoolean
receiverNameThis field is for the person receiving the invitation (Wallet User B) to set a name by which the invitation will be addressed byName (e.g. Wallet-B)

Sample Request

curl --location --request PUT '{{WS_BASE_URI}}/me/delegate-connection-invitations/invite-response/{invitationId}?accept=true&receiverName=Wallet-B' \
--header 'Authorization: {{WALLET_SESSION_TOKEN}}'

Sample Response

{
"identifier": "dfe797bd-2d56-4a46-ab22-d7e5cfd82f18",
"inviter_wallet_account_id": "7e941e99-d3e2-4c2f-921f-36f3d563f8fe",
"receiver_wallet_account_id": "290875ef-ff02-4c6f-a781-9ee621e449d0",
"invite_name": "Alice",
"receiver_name": "Bob",
"status": "PENDING_CONFIRMATION",
"expires_at": "2022-10-11T10:21:52.000Z",
"revoked_on": null
}

Confirm Invite

note

The Wallet Session must be of the user that called Create Invite

Request Attributes

ParameterDescriptionSuggested value
invitationIdThe identifier for the invitationInvitation Id
confirmA true or false value that configures whether to confirm invitation or notBoolean

Sample Request

curl --location --request PUT '{{WS_BASE_URI}}/me/delegate-connection-invitations/response-confirm/{invitationId}?confirm=true' \
--header 'Authorization: {{WALLET_SESSION_TOKEN}}'

Sample Response

{
"identifier": "dfe797bd-2d56-4a46-ab22-d7e5cfd82f18",
"inviter_wallet_account_id": "7e941e99-d3e2-4c2f-921f-36f3d563f8fe",
"receiver_wallet_account_id": "290875ef-ff02-4c6f-a781-9ee621e449d0",
"invite_name": "Alice",
"receiver_name": "Bob",
"status": "COMPLETED",
"expires_at": "2022-10-11T10:21:52.000Z",
"revoked_on": null
}

Create Delegate Access

note

The Wallet Session of the delegator is used in the following call

Request Attributes

ParameterDescriptionSuggested value
client_idThe identifier of the UMA clientUMA client id
display_nameThe name given to the delegation. For instance, if Alice delegated access to Bob, the display name could be Alice-BobDisplay name
expires_inThe duration after which the delegated access will expireNumerical Value in milliseconds (E.G., 30000000)
dsa_idThe datasource account id of the delegatordatasource account id
delegate_connection_idThe identifier of the delegate connectionconnection id

Sample Request

curl --location --request POST '{{WS_BASE_URI}}/me/delegate-access' \
--header 'Authorization: {{WALLET_SESSION_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"dsa_id": "datasource_account_id",
"expires_in": "30000000",
"client_id": "uma_client_id",
"delegate_connection_id": "connection_id",
"display_name": "Alice-Bob"
}'

Sample Response

[
{
"identifier": "db12004d-2af1-4ed6-95ff-40f858486423",
"expires_at": "2022-10-12T10:24:57.000Z",
"wallet_account_a": "7e941e99-d3e2-4c2f-921f-36f3d563f8fe",
"wallet_account_b": "290875ef-ff02-4c6f-a781-9ee621e449d0",
"created_by_invitation_id": "dfe797bd-2d56-4a46-ab22-d7e5cfd82f18"
}
]

Create Permission with Delegate Access

note

The Wallet Session of the delegatee is used in the following call

Request Attributes

ParameterDescriptionSuggested value
delegate_access_idAn identifier for access delegationaccess id
rs_res_idAn identifier for the resource server resourceresource_id
client_idThe identifier for the UMA clientuma_client_id
scopes_grantedThe scopes that are granted (read, edit, etc.)["granted scope"]

Sample Request

curl --location --request POST '{{WS_BASE_URI}}/tx/{tx_id}/permissions' 
--header 'Authorization: {{WALLET_SESSION_TOKEN}}'
--header 'Content-Type: application/json'
--data-raw '[{
"delegate_access_id": "access_id",
"rs_res_id": "resource_id",
"client_id": "uma_client-id",
"scopes_granted": ["read"]
}]'

Sample Response

{
"permission_code": "601010",
"permissions": [
{
"id": "WTSJb6OLG7UPzIhZ",
"created": "2022-10-11T10:48:13.000Z"
}
]
}

Delegate Access Revocation

note

The Wallet Session of the delegator is used in the following call

Sample Request

curl --location --request DELETE '{{WS_BASE_URI}}/me/delegate-access/identifier' \
--header 'Authorization: {{WALLET_SESSION_TOKEN}}'

Sample Response

{
"identifier": "8e0d0afd-83cc-4971-8741-831a064ababc",
"owner": "7e941e99-d3e2-4c2f-921f-36f3d563f8fe",
"delegated_to": "290875ef-ff02-4c6f-a781-9ee621e449d0",
"expires_at": "2022-10-11T18:57:53.000Z",
"revoked_on": "2022-10-11T11:20:18.993Z",
"enrolled_client": {
"identifier": "fpxsp_uma_client",
"name": "Learning Management Platform",
"policy_uri": "https://identos.com/wp-content/themes/identos/images/apple-touch-icon-114x114.png",
"icon_uri": "https://identos.com/wp-content/themes/identos/images/apple-touch-icon-114x114.png",
"tos_uri": " ",
"authorization_server": {
"identifier": "IDN AuthServer",
"organization": {
"id": "1",
"name": "Learning Management Platform"
}
}
},
"display_name": "Alice-Bob"
}