Create and send an administrative session for approval
Introduction
Administrative sessions are created each time an admin needs to add or update the admin settings in the Custody Infrastructure system.
This is an API process. Be sure you are comfortable making API calls and interpreting the responses. See Getting started with the API for details.
Summary
This article covers:
*Endpoint Deep Dive - Expanded
- getAdministrativeSessionInfo
- startAdministrativeSession
- submitAdministrativeSession
- cancelAdministrativeSession
What is an Admnistrative session?
An administrative session allows an admin to create new setting or update existing ones. These are then forwarded to approvers before the settings are applied to the system. Any administrative function can be called during this session. With each action the message number must be incremented to track the activity of the session.
How it Works
The administrator creates a new session and sets the message number to 1. Using the system snapshot data, the admin assigns the data and starts the session. Then the admin increments the message number. Now any setting definition or change can be made using any of the administrative session API calls. Multiple actions can be added at this stage. Finally, the message number must be incremented again and the session submitted so that it can be sent to the approvers to OK.
%%{
init: {
'theme': 'base',
'themeVariables': {
'primaryColor': '#9B69FF',
'primaryTextColor': '#EFEFEF',
'secondaryColor': '#CCCCCC',
'secondaryTextColor': '#CCCCCC',
'lineColor': '#9B69FF',
'arrowColor': '#9B69FF',
'fontFamily': 'Arial, sans-serif, bold',
'fontSize': '24px',
}
}
}%%
flowchart TD
A{Check for existing session} -->|<span style="color: black;">Yes</span>| C[Cancel existing session]
A{Check for existing session} -->|<span style="color: black;">No</span>| B[Create new session]
C --> B[Create new session]
B -->|<span style="color: black;">Message Number =1</span>| D[Start session with snapshot id data]
D --> E[Increment Mesage number]
E --> |<span style="color: black;">Mesage number =2</span>| F[Action or update to settings]
F --> G[Increment Mesage number]
G --> |<span style="color: black;">Mesage number =3</span>|H[Submit session for approval]
style A fill:#9B69FF,color:#fff
style B fill:#9B69FF,color:#fff,rounded
style C fill:#9B69FF,color:#fff,rounded
style D fill:#9B69FF,color:#fff,rounded
style E fill:#9B69FF,color:#fff,rounded
style F fill:#9B69FF,color:#fff
style G fill:#9B69FF,color:#fff
style H fill:#9B69FF,color:#fff
Call-by-Call Walkthrough
The administrative_message_number lists the number of calls made in this session. This is important for tracking and following up on the progress of work and flow you are performing. This uses the incrementMessagenumber() command to increment the number.
If an administrative session already exists, use the getAdministrativeSessionInfo() command to call and retrieve the sessionmessage number.
Check for an existing session
Ensure that no sessions are open. If a session is open, then it is closed. This ensures that when you start your new session the administrative message number can be set to 1, to allow accurate tracking of your messages.
Create a new administrative session and define the message number in requestExtraData
This create the session id, which uses the Universal Unique identifier(uuid) with a 36 character limit.
Use the RequestExtraData field to define the administrative message value, which should be set as 1 for the first message.
Start the administrative session
Define the snapshot ID by calling for the function data and the snapshot id for the administrative session.
The snapshot is a reference taken of the administrative settings of this session at a specific timestamp.
Increment the message number
For each administrative session action increment the message number to make sure the tracking is correct.
Administrative action
Make the adminstartive change, update or action. In this example we will set a new max fee for the BitCoin currency in a given account.
Multiple updates or actions can be made at this point. There is no limit to the number of actions that can be added. Once this actions are added, the message number must be incremented.
Increment the message number
Use the same function to increment the message number.
Submit the administrative session update for approval
Submit the session so that it can be sent to the approvers.
Endpoint Deep Dive
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"id": "string"
});
var requestOptions = {
method: 'GET',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.cakes.com", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));For more information about this endpoint, see /getAdministrativeSessionInfo.
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"id": "string"
});
var requestOptions = {
method: 'GET',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.cakes.com", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));For more information about this endpoint, see /startAdministrativeSession.
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"id": "String"
});
var requestOptions = {
method: 'GET',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.cakes.com", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));For more information about this endpoint, see /submitAdministrativeSession.
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"id": "String"
});
var requestOptions = {
method: 'GET',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.cakes.com", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));For more information about this endpoint, see /cancelAdministrativeSession.
Further Reading
- To understand API responses, see API Responses