Failed to fetch Data from API2 - Manager Cloud Edition

@lubos

Failed consuming API2

https://editor-next.swagger.io/ - Failed

Failed to fetch.
Possible Reasons:

CORS
Network Failure
URL scheme must be "http" or "https" for CORS request.

Windows PowerShell - OK

PS C:\> $headers = @{
>>     "accept" = "application/json"
>>     "X-API-KEY" = "************************=="
>> } 
                                                                                                                                                                                                         PS C:\> Invoke-WebRequest -Uri "http://***********.manager.io/api2/access-tokens" -Method Get -Headers $headers


StatusCode        : 200
StatusDescription : OK
Content           : {
                      "business": {
                        "name": "Inventory SOP"
                      },
                      "skip": 0,
                      "pageSize": 50,
                      "totalRecords": 1,
                      "accessTokens": [
                        {
                          "key": "c4f541d3-1cf3-4386-9851-fcdc7026****",
                          "image": nul...
RawContent        : HTTP/1.1 200 OK
                    Transfer-Encoding: chunked
                    Connection: keep-alive
                    Access-Control-Allow-Headers: *
                    Access-Control-Allow-Methods: *
                    Access-Control-Allow-Origin: *
                    Cache-Control: no-cache, no-store...
Forms             : {}
Headers           : {[Transfer-Encoding, chunked], [Connection, keep-alive], [Access-Control-Allow-Headers, *], [Access-Control-Allow-Methods, *]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 304

Has anyone experienced it?

Solved,
The Import URL gives us the address http://{subdomain}/manager.io/api2, we have to change it manually to https://{subdomain}/manager.io/api2

from

{
  "openapi": "3.0.0",
  "info": {
    "title": "Manager API",
    "version": "24.2.19.1307"
  },
  "servers": [
    {
      "url": "http://{subdomain}.manager.io/api2"
    }
  ],

to

{
  "openapi": "3.0.0",
  "info": {
    "title": "Manager API",
    "version": "24.2.19.1307"
  },
  "servers": [
    {
      "url": "https://{subdomain}.manager.io/api2"
    }
  ],
1 Like

Good catch. Fixed in the latest version.

3 Likes