SwaggerHub Registry API - Can't get list of private apis

36 views
Skip to first unread message

Samuel Pedro

unread,
Nov 7, 2018, 7:39:20 AM11/7/18
to Swagger
Hi everyone!

I'm trying to use /apis/{owner} that "Retrieves an APIs.json listing of all APIs defined for this owner", from  SwaggerHub Registry API's to get my own API's.

I'm in an angular project and I can already get the response of a request to get the public apis from a owner, 

  1. {name: "Default listing", description: "Default registry listing", url: "apis/arctouch3", offset: 0, totalCount: 3, …}
    1. apisArray(3)
      1. length3
    2. description"Default registry listing"
    3. name"Default listing"
    4. offset0
    5. totalCount3
    6. url"apis/arctouch3"

but when i try to get my list of api's that are private a response is that i don't have api.

  1. {name: "Default listing", description: "Default registry listing", url: "apis/myusername", offset: 0, totalCount: 0, …}
    1. apisArray(0)
      1. length0
    2. description"Default registry listing"
    3. name"Default listing"
    4. offset0
    5. totalCount0
    6. url"apis/myusername"

I already config the "apiConfiguration" with my api key like this, including my username and password to see if i can be successed but with no valid results


apiConfiguration: {
apiKeys: { shKey: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' },
username:'myUsername',
password: 'myPassword'
},


What's necessary for me to get the list of private api?



Samuel Pedro

unread,
Nov 7, 2018, 10:26:05 AM11/7/18
to Swagger
Hi everybody!

Solved my problem!

Had a problem with the configuration that i made.

when i call my service i'm giving a configuration and that configuration was wrong.

This is the wrong one

{
production: true,
apiConfiguration: {
apiKeys: { shKey: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' },
},
};


This is my new and correct configuration

{
production: true,
apiConfiguration: {
apiKeys: { Authorization: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' },
},
};
Reply all
Reply to author
Forward
0 new messages