Discussions

Ask a Question
Back to All

Access Denied Error for API Requests

Dear ServiceM8 Developer Support,

I am reaching out for assistance with an issue I am encountering while developing an add-on for ServiceM8. Specifically, I am experiencing an access_denied error when attempting to access the /v1/jobs.json endpoint and the /v1/tokeninfo.json endpoint.


Details of the Issue

  • App Name: Customer Portal
  • App ID: 317092
  • Redirect URI: http://localhost:3000/callback
  • Requested Scope: read_jobs
  • Error Encountered:
    • Endpoint: https://api.servicem8.com/v1/jobs.json
    • Error Response:
      <html>
        <head>
          <meta http-equiv="refresh" content="0; url=/access_denied?strFrom=%2Fv1%2Fjobs.json">
        </head>
        <body>Page Not Found</body>
      </html>
      

Steps Taken

  1. OAuth Authorization: I am successfully obtaining an access token after requesting the read_jobs scope.
  2. Access Token Details: The token is being passed in the Authorization header for API requests as Bearer <token>.
  3. Manifest Configuration: The app manifest includes the correct scopes field, as follows:
    {
        "scopes": ["read_jobs"]
    }
    
  4. Testing: Despite following the documentation, API requests to both /v1/jobs.json and /v1/tokeninfo.json return the access_denied error.

Request for Assistance

Could you please help me confirm:

  1. If the requested scope (read_jobs) is being correctly granted to my app.
  2. If there are any configuration issues with my app setup in the Developer Portal.
  3. If there are additional steps required to access the /v1/jobs.json endpoint.

I appreciate your guidance on resolving this issue.


Thank you for your support, and please let me know if you require any additional information.

Best regards,
Marcello