Help Center/ ROMA Connect/ User Guide (ME-Abu Dhabi Region)/ Troubleshooting/ Service Integration/ Error Message "The API does not exist or has not been published in an environment" Is Displayed When an API Is Called Using JavaScript
Updated on 2024-07-10 GMT+08:00

Error Message "The API does not exist or has not been published in an environment" Is Displayed When an API Is Called Using JavaScript

Cause Analysis

The possible causes are as follows:

  • The API is not published in an environment.
  • The URL to be accessed is different from that in the API details.
  • The API uses the OPTIONS method for cross-domain requests. However, CORS is not enabled and OPTIONS is not selected for Method during API creation.

Solution

  • Publish the API in an environment.
  • Modify the URL to ensure that the URL is the same as that in the API details. If a slash (/) is missing after the URL, the API cannot be matched.

    Example: http://example.com/test/ and http://example.com/test match different APIs.

  • Enable CORS and select OPTIONS for Method when creating the API.