Skip to content

Troubleshooting

How do you read the API errors?

Each error contains 3 pieces of information separated by a | symbol.

  • The first part shows you the row within the CSV where the error occurred.
  • The second part shows the schedule, which the error is for, and
  • The third part shows the error message.

Example response error

{
  "errors":["6|Pilot1|The 'Off duty date' (1/2/2015 2:00 PM) cannot be more than 30 hours after the 'On duty date' (1/1/2015 1:53 AM)."]
}
Why is my API request not returning any response?

Not all SAFE APIs will return a response. Here is a list of APIs that will return a response.

  1. Token API returns bearer token
  2. UploadRoster endpoint returns a roster token if the upload was successful
  3. GetResults endpoint returns error messages and fatigue scores.
  4. ProcessFatigue endpoint returns fatigue scores.
  5. ProcessFatigueRisk endpoint returns fatigue risk scores.

If these endpoints are not returning any response, more than likely, the payload you have sent to these endpoints is invalid or missing a mandatory field. Recheck the payload to confirm that the payload holds correct data.

If the problem persists, contact our support team with a raw trace of request and response.

UploadRoster endpoint is not showing errors in the file. How do we resolve the errors?

UploadRoster does not display errors. If you get a roster token from UploadRoster endpoint, your roster data was uploaded correctly.

But you still need to use the GetResults endpoint to verify if the data is valid. This is how you can check for errors in your uploaded roster data.

  1. Call the GetResults endpoint by setting the dataKey parameter to status.
  2. If the response is not completedsuccessfully, call the GetResults endpoint again, but this time set the dataKey parameter to feedback. You should be able to view any errors in the uploaded data.
I keep getting 401 error when sending requests to the API. How to resolve?

401 errors happen when the client ID, the client secret, or the bearer token you used is incorrect. Make sure you copy the right client ID and client secret from the web UI to get a bearer token.

If you still get 401 error after copying the right client secret and client ID from the web UI, reload the page and copy the secret again. Your client ID will stay the same.

If the issue is not fixed, email our support team with a raw trace of request and response.

What is base64 encoding and how do you encode client ID and client secret using base64 encoding?

It is binary to a text encoding scheme that represents binary data in an American Standard Code for Information Interchange (ASCII) string format.

Most platforms that allow using APIs will automatically convert your string of <ClientID>:<ClientSecret> to base64. If they don't, you can use online tools to help you with that.

I keep getting a 500 error when sending requests to the API. How to resolve?

500 errors occur when our server cannot process the data you sent in the API request. Make sure you include all the required fields in the request body or parameters.

If the error continues, make sure you use valid values for the fields and parameters. You can find the schema description in our API reference documentation to see the required fields and parameters and their valid values. You can also look at the Schema sections of the SAFE Application API and SAFE Swift API to understand the fields and their values.

If the issue is not resolved, email our support team with a raw trace of request and response.

What is the format for RosterData and ActivityData properties?

RosterData and ActivityData accept CSV data in JSON format. You can include multiple rows of data in these properties. For more information on the CSV columns, see our API reference documentation or the Schema sections of the SAFE Application API and SAFE Swift API.

To create a new row in JSON format, do not press the Enter ⏎ key. Use \r\n (with no spaces around it) to separate the rows for RosterData and ActivityData.

What do the fatigue scores mean? How to read them?

Each comma-separated value indicates a fatigue score (based on the scale you chose) at 15-minute intervals. Refer to the Results Breakdown page to learn more about what each of those scores mean.

I am preparing the payload for Roster and Activity data, but I don't know how to send multi-line data.

To create a new row for RosterData and ActivityData, do not use the Enter ⏎ key as it will not work. Use \r\n (with no spaces before or after) to separate the rows of RosterData and ActivityData.

There are multiple authorization methods in API reference. Which should I choose?

Our API uses OAuth2.0 for authentication, which is the preferred option for testing our APIs in the API reference documentation. Bearer and basic authentication methods are simplified implementation of OAuth2.0.

The basic authorization method asks for username and password. There is no place to enter Client ID and Client Secret.

Basic Authorization methods require a username and a password as per the Open API 3.0 specification that we adhere to.

For basic authorization, use Client ID as the username and Client Secret as the password.

I tried everything but couldn't resolve the errors. I need to contact support.

For support, please email us at support@frmsc.com. To speed up the troubleshooting process, please attach the raw trace of request and response to your email. You can find the raw trace of the API request in the console of your API testing tool or your browser window. Here is a sample of raw trace (from Postman console):

  POST /api/Processor/ProcessFatigue HTTP/1.1
  Content-Type: application/json
  Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCP6IjBFNUMxNEU4OEIzRjFFMEFCNDlGNUIzMkU5NzNDMDQ0NkY0MjJDRURSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IkRsd1U2SXNfSGdxMG4xc3k2WFBBUkc5Q0xPMCJ9.eyJuYmYiOjE3MDYwMDMzNzYsImV4cCI6MTcwNjAwNjk3NiwiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS1ldS5mcm1zYy5jb20iLCJhdWQiOiJmcm1zY19mYXN0X3NhZmVfcmlza19hcGkiLCJjbGllbnRfaWQiOiI1NDcxRTAxMC1EREVFLTRDOTgtRkY4Ri0wOERCMjI0NUUzNzIiLCJqdGkiOiIyQUNCMDRFMzFGQkJFN0ZEMDc0RTEwRUEzOTJBNDBENCIsImlhdCI6MTcwNjAwMzM3Niwic2NvcGUiOlsiZnJtc2NfZmFzdF9zYWZlX3Jpc2tfYXBpIl19.gD9a-kjilX-uQ6ashWX6dTSFaGhKFqVujkyb1R8Zq4jNnH4pL5Omq4rBB8wPt3fvps_WBXRuG7ZrDnoth2HaTNMwgEeH9sdZR9xiWlkmhdXiXasUWTR_iAcW_a68bCMiGKPT5STSiIkO-hrPwDFni-fIg5LjAHUvmEZ6n4EtmiAyU1sSG939qFM6p6FK9GIZkAp9fStyqZF7PNK7djOCvv6_NNZXypmM88TL3_naVkE1aH4BPecjUhwECTzmxmkt8lcCx658IHBPAeXS3a6rlo3cFKosWsb08cVgYutn4I764-8CMTTNp1umWeYWVWl9YbxV_ynNTI7VNlOJLCZwaw
  User-Agent: PostmanRuntime/7.36.1
  Accept: */*
  Cache-Control: no-cache
  Postman-Token: 3525292c-2e40-47b3-9ea6-f2ad4ec930e1
  Host: api-eu.frmsc.com
  Accept-Encoding: gzip, deflate, br
  Connection: keep-alive
  Cookie: ARRAffinity=c349e3b3a841e0f145827e7b45147850448801356063dc14e966fbfa5b7979c5; ARRAffinitySameSite=c349e3b3a841e0f145827e7b45147850448801356063dc14e966fbfa5b7979c5

  {
  "RosterData": "Pilot1,12/05/2023,19:45,SNA,13/05/2023,04:07,RSW,SNA,2",
  "SleepData": [
  {
  "ScheduleName": "Pilot 1",
  "SleepStart": "2023-01-02T19:57:00Z",
  "SleepEnd": "2023-01-02T20:30:00Z"
  }
  ],
  "DateFormat": "dmy",
  "PreferredScale": "SP"
  }

  HTTP/1.1 403 Forbidden
  Content-Length: 0
  Date: Tue, 23 Jan 2024 09:51:07 GMT
  Server: Microsoft-IIS/10.0
  Request-Context: appId=cid-v1:b5aa80b1-72af-42a2-bc7b-e827ba340897
  X-Powered-By: ASP.NET
I don't see a button to add activity through UI.

There are no main menu buttons to add activity to a duty. Instead, right-click on the duty to which you want to add the activity and choose Activity from the context menu. See our UI workflow for step-by-step instructions to add activity.

When uploading duty and activity, I get errors, but I don't see how to resolve them.

When you bulk upload the schedule, you won't be able to resolve the errors from UI. You must return to the CSV file and resolve the error shown in the UI.

Then, delete the roster with faulty data and re-upload the schedule.