GyrusAim provides a layer to customers which is responsible for interacting and dealing with incoming requests. Since HTTP is stateless, the GyrusAim API will verify and authenticate this request and respond back with the requested data if available. If the request is not verified or authenticated then the API will respond accordingly with a specific error code, message and description (troubleshooting description and not a stack trace). The error code is sent according to HTTP standards and/or it can be customized per GyrusAim's application standards.
GyrusAim verifies and authenticates the incoming request using an API key and secret (or token) combination. For example, if a company wants to create their own mobile application and wants to access their GyrusAim data, the GyrusAim user who has administrative rights will enable the API for the system, and create an encrypted API key and secret, or token, combination. The administrator will give this encrypted API key and secret (or token) combination to the related person/developer who will use this to access the data from the GyrusAim API. This API key combination must be kept secret to prevent unauthorized access. The API key combination must be included in HTTP(S) while making a request. The GyrusAim API will respond accordingly with the applicable data and status codes. Data can be JSON or XML depending upon the requested type.
Now time to used API
functionality, for that below some point need to cover
1. Manage External Application Master
Now you need to create a new External Application (if not
existing already), for that follow these steps:
Figure 1.1
Figure 1.2
As per figure 1.2, this is the display list of External Application page. This list displays all types of External Application, like General, Etc. The Admin can Create, Update and Delete External application from this page.
Create:- For creating a new External application, click on the Add (Plus) button. Then redirect to new creation of External Application page.
Update:- For updating an external application's record, hover over the Action Button ('...') next to the name of external application name and click "Edit" to edit external application page.
Delete:- To delete a record, select any record using the check box and click on Delete (Trash) button.
Figure
1.3
Figure 1.4
Above figure 1.3 and 1.4 to Create or Update page of External Application. Here you can add new application with accurate data like application name, domain name, application type and so on and save it. Below are the fields you need to enter as per your requirement:
Column Name |
Remark |
Name |
Unique Name of the application |
Domain Name |
Requests will be allowed from this given domain name. Otherwise request will be reject with 400 http status code. For example, gyrus.com, xyz.com etc... Note: domain name with sub domain name will be treated separated. E.g. abc.com and xy.abc.com will be treated as different. |
Application Type |
Application Type. · General (Default for API) · GTIMS (Customized) For example, General, GTIMS, LMS1, LMS2 etc... |
Max Allowed Requests Per Hour |
Maximum allowed request to GyrusAim API per hour. (-1 for unlimited) |
Push URL |
Push URL on which GyrusAim will push the data or status. (Optional) (Only POST request will be pushed. Your URL must be able to handle the posted data.) |
Is CORS enable |
To enable/disable CORS (Cross-Origin Resource Sharing) functionality. Refer section 10.0 . Click here for view more information regarding CORS. |
ParameterFieldKey1-4 |
Parameter key which needs to be push.(Optional) |
ParmeterFieldValue1-4 |
Parameter value which needs to be push.(Optional) |
Client Key |
Client key will be used as identity record. This will be generated after application in created. This is must required in every request made to GyrusAim API. (This should be kept secret) |
Client Secret |
Client Secret will act as token for above client key. This always need to be above mentioned client key. This will be generated after application in created. This is must required in every request made to GyrusAim API. This should be kept secret too) |
Token Valid From |
Generated token will be valid from. |
Token Valid Up To |
Generated token will be valid upto. (Token will be expired after this date) |
Default value:-
· Valid From – Current Date
· valid up to – After 1 year from current date.
Now here you can see the API Event Selection, (See figure 1.4) which used for external application wise API events that decided by user and only such events are manage by particular external application. For example, if application associated with GET_EMPLOYEE, then GyrusAim provides employee detail when the request will be made to the GyrusAim API. Now after filling the required field values, click on save. After save, you can see that client key and client secret is generated. At this stage you are ready to make a call to the GyrusAim API.
GyrusAim will create a clean URL for making a request. The API link will be generic, such as www.api.gyrusaim.com/api. Users can call the API with the request types GET, POST or DELETE.
<?xml version="1.0" encoding="utf-8"?>
|
{ "token": { "clientkey": "D5756FE1C4E2", "clientsecret": "idES0ERwv73Q" } } |
Filters are useful when you want to set criteria for data you are getting in
the response. This will help to get specific data you want. Filters can be
applied on most of the list method (Please check with documentation first
before applying filter to any method)
<?xml version="1.0" encoding="utf-8"?> |
{ "filters":{ "classCode":"class001" }, "token": { "clientkey": "D5756FE1C4E2", "clientsecret": "idES0ERwv73Q/P3xEeZKlY" } } |
The above filter structure is an example of class filter which is applied to /Class/List method. Here you can see that classCode filter is applied with value of “class001”. In the response you will get only a record which is having class code “class001”.
In case of insert/update/delete of entity through API, if record is inserted, updated or deleted successfully you will get the below success response from the API.
Json:
Xml:
In case of any error occurred during process of request you will get error response from the API. Refer to section 5.0 for HTTP status code with GyrusAim status codes. Here is an example.
Json:
Xml:
When a user makes a request to the GyruaAim API, it will first validate the token information (Client key and Client Secret). If the token is not verified then HTTP status code 400 will be received with other GyrusAim status information. (See upcoming section 5.0 for related HTTP status code as well as other GyrusAim status information and messages).
After successful authentication, as mentioned above, in same request, the GyrusAim API checks for authorization. GyrusAim checks that give token is authorized for get/insert/update for specific entity or not based on configuration made during Application creation process. If it is not authorized, then HTTP status code 403 will be received with other GyrusAim status information.
Note: Authentication process means to validate each request which is made to API. Do not mix it with oAuth process which is used in log-in process.
The possible list of HTTP status codes and others GyrusAim status code that GyrusAPI return in response to request are as follows. GyrusAim status code helps you to figure out the possible solution in case of any error or requirement. You can use this code along with HTTP status code.
HTTP Status code |
GyrusAim Status code |
GyrusAim Status |
Message |
Description |
200 |
7000 |
ok |
success |
|
400 |
7001 |
failed |
failed |
|
401 |
7002 |
forbidden |
UnAuthorized |
Unauthorize request. Make sure your client key and client secret is valid |
401 |
7003 |
permissionDenied |
permissionDenied |
Permission denied. Make sure you have sufficient privileges |
400 |
7004 |
maxRequestLimitReached |
maxRequestLimitReached |
Max request limit is reached for this api. Try after sometime or contact your API administrator |
400 |
7005 |
apiExpired |
apiExpired |
API expired. Contact your API administrator |
400 |
7006 |
invalidDomainName |
invalidDomainName |
The domain from which you are trying to make request is not matched or invalid. Domain name should be same as configured in GyrusAim. |
400 |
7007 |
invalidToken |
invalidToken |
Token verification failed. Make sure you passed the correct client key and client secret |
500 |
7008 |
unHandledException |
unHandledException |
An unhandled exception is occurred. Please contact system administrator. |
400 |
7010 |
fieldRequired |
fieldRequired |
One or more fields are required. See errors for more details |
400 |
7011 |
missingApplicationConfiguration |
missingApplicationConfiguration |
Make sure your application is configured properly in GyrusAim |
400 |
7012 |
invalidRequestStructure |
invalidRequestStructure |
Check your posted xml or json request structure |
400 |
7013 |
businessLogicError |
businessLogicError |
Business logic error occurred. See error for more details |
Request Information |
|||||||||||||||||||||||||||||||||||||||||
URL |
|||||||||||||||||||||||||||||||||||||||||
Request Type |
POST |
||||||||||||||||||||||||||||||||||||||||
Content Type |
application/json or application/xml |
||||||||||||||||||||||||||||||||||||||||
Token Required |
Yes |
||||||||||||||||||||||||||||||||||||||||
Description |
To get list of employees |
||||||||||||||||||||||||||||||||||||||||
Filter |
Employee filters can be used |
||||||||||||||||||||||||||||||||||||||||
|
|
6.1 Employee Request Data Structure
Json:
{
"filters": {
},
"paging": {
"pageIndex": 0,
"pageSize": 10
},
"token": {
"clientKey": "E258DFB34ED6",
"clientSecret":"A0qmts7UqWobsTUGOJUFbJAY94oB904agBNb6TNJLgWBIFDmLbkefydg0bIHnx3SeZwKHka5cm02U/Ee"
}
}
In JSON |
In XML |
Notes |
employeeNumber |
EmployeeNumber |
Required for insert/update |
firstName |
firstName |
Required for insert |
middleName |
MiddleName |
|
lastName |
LastName |
Required for insert |
|
|
Required for insert |
title |
Title |
|
address1 |
Address1 |
|
address2 |
Address2 |
|
city |
City |
|
state |
State |
|
postalCode |
PostalCode |
|
country |
Country |
|
notes |
Notes |
|
employeeStatus |
EmployeeStatus |
|
userName |
UserName |
|
supervisors |
Supervisors |
Array of supervisor codes |
organizationCode |
OrganizationCode |
|
hireDate |
HireDate |
|
expirationDate |
ExpirationDate |
|
prefix |
Prefix |
|
suffix |
Suffix |
|
nationalReference |
NationalReference |
|
termDate |
TermDate |
|
restartDate |
RestartDate |
|
jobName | JobName | |
jobCode | JobCode | |
isPrimary | IsPrimary | |
role_id | Role_Id | |
role_name | Role_Name |
JSON:
{
"employees": [
{
"employeeNumber": "sample string 1",
"firstName": "sample string 2",
"lastName": "sample string 3",
"hireDate": "sample string 4",
"expirationDate": "sample string 5",
"email": "sample string 6",
"prefix": "sample string 7",
"suffix": "sample string 8",
"title": "sample string 9",
"middleName": "sample string 10",
"nationalReference": "sample string 11",
"termDate": "sample string 12",
"restartDate": "sample string 13",
"address1": "sample string 14",
"address2": "sample string 15",
"city": "sample string 16",
"state": "sample string 17",
"postalCode": "sample string 18",
"country": "sample string 19",
"employeeStatus": "sample string 21",
"userName": "sample string 22",
"supervisors": {
"supervisor": [
{
"employeeNumber": "sample string 1"
},
{
"employeeNumber": "sample string 1"
}
]
},
"organizationCode": "sample string 23",
"password": "sample string 24",
"windowsUserName": "sample string 25",
"gyrusUserRoleAssociationList": [
{
"role_id": 1,
"userID": 2,
"role_name": "sample string 3"
},
{
"role_id": 1,
"userID": 2,
"role_name": "sample string 3"
}
],
"gyrusUserJobAssociationList": [
{
"IsPrimary": true,
"JobName": "sample string 2",
"JobCode": "sample string 3",
},
{
"IsPrimary": false,
"JobName": "sample string 2",
"JobCode": "sample string 3",
}
]
]
}
Request Information |
|
URL |
|
Request Type |
POST |
Content Type |
application/json or application/xml |
Token Required |
Yes |
Description |
To insert employee |
Filter |
NA |
The request data structure for insert as follows:
JSON:
{
"employee": [
{
"employeeNumber": "sample string 1",
"firstName": "sample string 2",
"lastName": "sample string 3",
"hireDate": "sample string 4",
"expirationDate": "sample string 5",
"email": "sample string 6",
"prefix": "sample string 7",
"suffix": "sample string 8",
"title": "sample string 9",
"middleName": "sample string 10",
"nationalReference": "sample string 11",
"termDate": "sample string 12",
"restartDate": "sample string 13",
"address1": "sample string 14",
"address2": "sample string 15",
"city": "sample string 16",
"state": "sample string 17",
"postalCode": "sample string 18",
"country": "sample string 19",
"employeeStatus": "sample string 21",
"userName": "sample string 22",
"supervisors": {
"supervisor": [
{
"employeeNumber": "sample string 1"
},
{
"employeeNumber": "sample string 1"
}
]
},
"organizationCode": "sample string 23",
"password": "sample string 24",
"DeleteExistingRoles": true,
"DeletedGyrusUserRoleId": "sample string 26"
},
{
"employeeNumber": "sample string 1",
"firstName": "sample string 2",
"lastName": "sample string 3",
"hireDate": "sample string 4",
"expirationDate": "sample string 5",
"email": "sample string 6",
"prefix": "sample string 7",
"suffix": "sample string 8",
"title": "sample string 9",
"middleName": "sample string 10",
"nationalReference": "sample string 11",
"termDate": "sample string 12",
"restartDate": "sample string 13",
"address1": "sample string 14",
"address2": "sample string 15",
"city": "sample string 16",
"state": "sample string 17",
"postalCode": "sample string 18",
"country": "sample string 19",
"employeeStatus": "sample string 21",
"userName": "sample string 22",
"supervisors": {
"supervisor": [
{
"employeeNumber": "sample string 1"
},
{
"employeeNumber": "sample string 1"
}
]
},
"organizationCode": "sample string 23",
"password": "sample string 24",
"DeleteExistingRoles": true,
"DeletedGyrusUserRoleId": "sample string 26"
}
],
"token": {
"clientKey": "sample string 1",
"clientSecret": "sample string 2"
}
}
Request Information |
|
URL |
|
Request Type |
POST |
Content Type |
application/json or application/xml |
Token Required |
Yes |
Description |
To update employee |
Filter |
NA |
The request data structure for update as follows.
JSON:
{
"employee" :{
"employeeNumber" : "Emp0029",
"firstName" : "Emp0029",
"lastName": "0029",
"expirationDate":"12/31/9999 12:00:00 AM",
"hireDate": "1/10/2022 12:00:00 AM",
"email": "emp29@test.net",
"title": "SE29",
"middleName":"E",
"userName":"e0029",
"DeleteExistingRoles":true,
"IsDeleteExistingJobs":true,
"IsDeleteExistingSupervisors":true,
"IsDeleteExistingOrganization":true,
"supervisors" :{
"supervisor" : [
{"employeeNumber":"10001"}
]
},
"gyrusUserRoleAssociationList":
[
{
"role_name":"Student"
}
],
"gyrusUserJobAssociationList":
[
{
"IsPrimary":false,
"JobName":"AdminSK",
"JobCode":"AdminSK"
}
],
"organizationcode" : "CM ORG12"
},
"token": {
"clientKey": "sample string 1",
"clientSecret": "sample string 2"
}
}
NOTE:
DeleteExistingRoles flag – If the user wants to replace roles, then we can set this flag to true, it removes existing roles and assigns new roles. Also, when we do not provide the flag or set it to false, then it adds new roles with existing roles.
IsDeleteExistingJobs flag - If the user wants to replace jobs, then we can set this flag to true, it removes existing jobs and assigns new jobs. Also, when we do not provide the flag or set it to false, then it adds new jobs with existing jobs.
IsDeleteExistingSupervisors flag - If the user wants to replace supervisors, then we can set this flag to true, it removes existing supervisors and assigns new supervisors. Also, when we do not provide the flag or set it to false, then it adds new supervisors with existing supervisors.
IsDeleteExistingOrganization flag - If the user wants to replace organizations, then we can set this flag to true, it removes the existing organization and assigns a new organization. Also, when we do not provide the flag or set it to false, then it adds new organizations within existing organizations.
Also, if we do not pass the above flag parameters, then they are considered to be set to false.
Request Information |
|
URL |
|
Request Type |
POST |
Content Type |
application/json or application/xml |
Token Required |
Yes |
Description |
To get a list of submitted assessments for specific employee |
Filter |
NA |
Json:
{
"startDate" : "mm/dd/yyyy",
"endData" : :"mm/dd/yyyy",
"token" : {
"clientkey" : "D576FE1C4E2",
"clientsecret" : "idES"
},
"paging" : {
"pageindex" : 0,
"pagesize" : 10
}
}
Xml:
<?xml version="1.0" encoding="utf-8"?>
<Root>
<startDate>mm/dd/yyyy</startDate>
<endDate>mm/dd/yyyy</endDate>
<Token>
<ClientKey>Your-ClientKey</ClientKey>
<ClientSecret>Your-ClientSecret</ClientSecret>
</Token>
<Paging>
<PageIndex>0</PageIndex>
<PageSize>10</PageSize>
</Paging>
</Root>
In JSON |
In XML |
Notes |
employeeNumber |
EmployeeNumber |
|
assessmentName |
AssessmentName |
|
dateCompleted |
DateCompleted |
|
isPassed |
IsPassed |
|
score |
Score |
|
note |
Note |
|
JSON:
{
"assessments" : [
{
"employeeNumber":"A001",
"assessmentName":"MyAssessment",
"dateCompleted":"mm/dd/yyyy",
"isPassed":"true",
"score":"70",
"notes":"My Notes"
}
]
}
Xml:
<Assessments>
<Assessment>
<EmployeeNumber>A001</EmployeeNumber>
<AssessmentName>MyAssessment</AssessmentName>
<DateCompleted>mm/dd/yyyy</DateCompleted>
<IsPassed>True</IsPassed>
<Score>70</Score>
<Notes>My Notes</Notes>
</Assessment>
</Assessments>
GyrusAim API provides external log-in functionality which is useful while you want to log-in into the GyrusAim directly from any another website. To implement the external log-in functionality you must have prior knowledge of java script and Jquery. (Find the external log-in sample example with this document).
Request Information |
|
URL |
|
Request Type |
POST |
Content Type |
application/json or application/xml |
Token Required |
Yes |
Description |
To get the token which used for external log-in. 24 hours validity |
Filter |
NA |
JSON:
XML:
Must required fields
|
Description
|
EmployeeNumber
|
Unique identification of employee
|
FirstName
|
First name of the employee
|
LastName
|
Last name of the employee
|
Username
|
User name of the employee
|
Email
|
Email address of the employee. (You should need to
pass 'NA' in case of user dose not have email address values in GyrusAim.)
|
Request Information |
|
URL |
|
Request Type |
POST |
Content Type |
application/json or application/xml |
Token Required |
Yes |
Description |
To validate external log-in token |
Filter |
NA |
JSON:
XML:
Request Information |
|
URL |
|
Request Type |
POST |
Content Type |
application/json or application/xml |
Token Required |
Yes |
Description |
To delete multiple employees upto 10 |
Filter |
NA |
With one delete request, a maximum 10 Employee records are allowed to be deleted.
Json:
{
"employeenumbers" : [
"string”,”string”,”string"
],
"token" : {
"clientKey" : "string",
"clientSecret" : "string"
}
}
In JSON |
In XML |
Notes |
employeenumber |
EmployeeNumber |
Processed record Employee Number |
success |
success |
Record result |
message |
message |
Record result message |
{
"deletepersonresult":
[
{
"employeenumber": "string",
"success": "boolean",
"Message": "string "
},
{
"employeenumber": "string",
"success": "boolean",
"Message": "string "
}
]
}