cancel
Showing results for 
Search instead for 
Did you mean: 

Integration APIs not working

SOLVED
vishal_sharma
Occasional Contributor

Integration APIs not working

I am trying to list all the APIs from my ORG published/unpublished on swagger hub to a bespoke dashboard. I am not able to see all the APIs. 

This is the URL I am using, along with my API Key.

https://api.swaggerhub.com/apis/{owner}

 

What I am getting is a partial list only, not the entire list. I tried a couple of filters as well listed - https://app.swaggerhub.com/apis/swagger-hub/registry-api/1.0.62 

1 ACCEPTED SOLUTION

Accepted Solutions
mhiggins
Staff

Re: Integration APIs not working

You are 100% correct. Domains are not APIs. but if you look at your Organization via the My Hub page the count of "assets" is the sum of APIs plus Domains. So if your 126 count is taken from that page it high by 4 (the domains). 

 

If the 126 is actually just APIs (use the built in filter below the search box for just APIs) then the GET call is not returning the correct count as you have already pointed out. 

 

Could you also please try the GET for /specs and see what that returns.

 

You can also open the support case and suggests. But I am very happy to keep trying to debug with you.  

 

Pending questions from me:

3) What Response do you receive to the GET /specs with limit=100 and no filters ?

4) Are you using the API Key of the Organization owner or someone else ?

5) In Organization Settings > Members, do you have "Allow Designers and Consumers to View all the Organization’s Private APIs" enabled ?

View solution in original post

12 REPLIES 12
mhiggins
Staff

Re: Integration APIs not working

are you using the page and limit parameters of the GET ?

 

by default the call will only return the first 10 APIs, you can change the limit to 100. If you have more then 100 then you need to increment page for each 100 next APIs.

 

this is from my On-premise SwaggerHub:

curl -X 'GET' \
  'https://swaggerhub.mwhiggins.com/v1/apis/SmartBear_Org?page=0&limit=100&sort=NAME&order=ASC' \
  -H 'accept: application/json' 

 

vishal_sharma
Occasional Contributor

Re: Integration APIs not working

Yes, I tried that, but still I am not getting the complete list. I've tried a couple of other filters (query params) but no luck.

mhiggins
Staff

Re: Integration APIs not working

are you using GET /apis/<org>    --or--    GET /apis

 

/apis/<org> doesn't support query parameters. here is my SaaS account using /apis/<org>

 

curl -X 'GET' \
  'https://api.swaggerhub.com/apis/mhiggins-sa?page=0&limit=100&sort=NAME&order=ASC' \
  -H 'accept: application/json'

 and here is the top few lines to the response:

 

Response body
Download
 
{
  "name": "Default listing",
  "description": "Default registry listing",
  "url": "apis/mhiggins-sa",
  "offset": 0,
  "totalCount": 4,
  "apis": [
    {
      "name": "KEMP LoadMaster API.",
      "description": "## KEMP LoadMaster ADC Public API\n\nKemp’s Virtual LoadMaster is a fully
vishal_sharma
Occasional Contributor

Re: Integration APIs not working

Thank you again for your prompt response. I am using the same URI. The challenge is I've more than 100 APIs. That is where I am putting in  filters for number of records but I getting around 42 back. Not sure why is that. 

Here is the snippet of my response.

"name": "Default listing",
"description": "Default registry listing",
{
"name": "Default listing",
"description": "Default registry listing",
"url": "apis/XXXXXXXCOE",
"offset": 0,
"totalCount": 42,
"apis": [

mhiggins
Staff

Re: Integration APIs not working

Ok, debugging tiime....

 

1) Can you show me the actual curl command that you are using when you get .totalCount of only 42 ?

2) What happens when you load the Registry API spec in SwaggerHub and use the Try-It feature for the GET /apis/<org> with limit=100 ?

3) What Response do you receive to the GET /specs with limit=100 and no filters ?

4) Are you using the API Key of the Organization owner or someone else ?

5) In Organization Settings do you have "Allow Designers and Consumers to View all the Organization’s Private APIs" enabled ?

 

 

vishal_sharma
Occasional Contributor

Re: Integration APIs not working

When trying from Postman - I am getting a count of 42 APIs. 

When running a cURL and/or registry API from web - I get 118

Where as total I have - 126.

If the issue is with the tool then why the field of total count is different. 

From Postman - "totalCount"42

From cURL - "totalCount": 118

From Swagger hub's registry API portal -  "totalCount": 118 "totalCount": 118

 

cURL Command : 

curl -X 'GET' \ 'https://api.swaggerhub.com/apis/XXXXXX?page=0&limit=100&sort=NAME&order=ASC' \ -H 'accept: application/json' \ -H 'Authorization: XXXXXXXXXXXX'

And Allow Designers and Consumers to View all the Organization’s Private APIs is enabled

mhiggins
Staff

Re: Integration APIs not working

Postman ?? What's Postman ? ha ha ha

 

is it possible that you have 8 Domains ??

vishal_sharma
Occasional Contributor

Re: Integration APIs not working

I've 4 domains - 

"totalCount": 4

 

 

But that shouldn't impact the number of APIs that I am receiving, from what I understand domain is the foundational building block that could be referred and it isn't a parent child relationship, thus mutually exclusive. Please advise. 

 

And yes, new to the place till the time cURL is installed have to make do. 😄 

LauraKennedy
Staff

Re: Integration APIs not working

Hello,

 

Could you please log this as a support ticket or through our Chat in the application so we can investigate this for you.

 

Thks,

Laura Kennedy

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors