API error: Forbidden

I am trying to test the APIs using Swagger but keep getting a forbidden error using both basic and token authentication. So far I have tried the following end points:

http://surveysuat/primary/api/v1/assignments
http://surveysuat/primary/api/v2/export

What is surveysuat?

surveysuat is the local server where the system is installed

Which means it is unreachable for anyone on this forum trying to assist.

You can try to reproduce with a PDS instance instead.

We tried with the PDS but we could not get a token. Any suggestion how we can trace the token.

We have setup an api user but when we try to run the api, we keep getting an unauthorised error on Swagger and Postman.

  1. Leave the token and Postman aside for the moment.
  2. Create an API user on the PDS.
  3. Use Swagger to authenticate as that very user in the appropriate workspace.
  4. Call an endpoint (specifically from the Swagger’s interface) that doesn’t require any parameters, such as this one: /api/v1/supervisors
  5. Report your observations with as much detail as possible.

Works for me:

I have managed point 3 was what caused my error. Was trying to access default workspace. Thank you for the support

Hello @BoZ ,

The API users are issued permissions to access specific workspaces (just like other non-admin users) and thus an attempt to access a not-allowed workspace will result in the HTTP 403 Forbidden response.

Thank you for confirming that you’ve managed to resolve the difficulty with the steps provided and confirmed that the software behaves as expected.

Wishing you all the success with your project!
Sergiy