SENAR API Documentation

Updated by Corine Barbazanges

This technical documentation will be helpful for developers and individuals working with SENAR data. It includes instructions on authentication, accessing user and activity lists, and creating webhooks to be notified when new data is available.

Each section below includes examples of endpoints and JSON responses for better guidance.

Authentication

You need to be authenticated to access Senar's data. Please contact support to obtain your login and password.

Endpoint

https://studio.senar.io/api/auth/login

Body: {
username: "xxx@xxx.com",
password: "********"
}

Response

Result: {
Token: "eedx..."
}

The resulting token is used in the rest of the requests to authenticate you. The token must be placed in the request header for the Authorization key.

e.g.: Authorization: Bearer <Token>

Users

The users register via a form available within the Senar application. Users endpoint returns all users linked to the authenticated user.

Endpoint

https://studio.senar.io/integration/data/users

Response

[{
"id": "765fc7cf-312b-469d-8508-0e943a6447c7",
"firstName": "Jon",
"lastName": "Doe",
"email": "jon.doe@my.mail",
"language": "en",
"accountName": "ACME",
"countryName": "USA",
"creationDate": "2022-09-07T06:25:23.9014976",
"profile": "Instructor"
}]

Activity

An activity represents the data collected when a user completes a scenario.

Endpoint

https://studio.senar.io/integration/data/activities

Response

[{
"id": 80119,
"collectionId": 41,
"userId": "b68bfbd8-8f26-427b-a3c9-2d4cec36648b",
"traineeId": "b5e3bbbc-0c22-417a-8087-6554afe26400",
"firstName": "Natalia",
"lastName": "Brown",
"company": "Daria",
"trainingDate": "2021-03-09T17:37:11.186836",
"scenarioId": "S01",
"scenarioName": "Scenario 1",
"totalPoints": 2900,
"totalSec": 622,
"totalTries": 1,
"simulatorId": 18,
"tilts": 0,
"totalMaxPoints": 3400,
"abandons": 1,
"collectionTitle": "Rigging",
"simulatorTitle": "Lifting Hardware and Sling Inspection",
"userFirstName": "Jon",
"userLastName": "Doe",
"userEmail": "jon.doe@my.mail",
"userCostCenter": "East",
"userAccountName": "ACME",
"traineeEmail": "guest-b45@senar.io",
"traineeProfile": "Guest"
}]

Webhook Registration

The webhook allows you to register the address that should be notified when new data arrives. You can register to receive new users or new activities by specifying the "method" parameter. The returned ID allows you to unsubscribe from the webhook.

Endpoint

https://studio.senar.io/integration/data/webhook_register

Request body:
{
hookUrl: "",
method: "activity" or "user",
provider: "zapier"
}

Response

Result: {
id: <id of the webhook>
}


How Did We Do?


Powered by HelpDocs (opens in a new tab)