Adding new APIs using Rest API in Portal

I am new to tyk,I am able to add the APIs in Portal using the Dashboard, but is there any way to add API’s to portal using Rest API. Does the portal has any rest resources that we can add APIs to it?

Thank You

Hey @Martin, Can you help me on this issue?

Hi Narendar,

this is currently not documented but you can check from your developer tool where the request is being sent and use that URL to sent your requests.

I will pass this to our technical writer and add it in our backlog.

Kos @ Tyk Support Team

Hey @Kos
Thank you for the update.
Can you help me how can check the URL from the developer tool?
Also, can I use the same Dashboard API JSON request ( POST ) for the portal developer ?

Narendar Gaddam

Hi Narendar,

you can check the Network tab on your dev tools and keep track of the XHR that Tyk sends.

Though the Portal uses a single catalogue object for everything and it’s not an atomic operation so it will be tricky.

Kos @ Tyk Support Team

Hi @Kos
Thanks for getting back.
I was able to get the URL from the network tab, I can see calls made when I add an api to the catalogue. It is making a put call (along with payload)whenever I added new API or updating an existing API. The issue I am seeing here is, when I am using the rest API to add a new API to the portal, it looks like it is replacing all the existing API’s and creating new API in portal.

I looked into network tab why this is not happening from the dashboard, I can see that when I add a new api from the dashboard , the request payload has all the API’s (from the catalogue) along with new API(that I am adding)
I tried with POST but I don’t see aything created in portal

Is this is a bug or Am I doing something wrong?
Here is the sample payload that I am using

{“id”:“xxxxxxxxxx”,“org_id”:“yyyyyyyyyy”,“apis”:[{“name”:“Test API 1”,“short_description”:“Test1”,“long_description”:“Test1”,“documentation”:"",“show”:false,“policy_id”:“zzzzzzzzzz”,“version”:“v2”}],"$promise":{},"$resolved":true}

Narendar Gaddam

You need to send the entire payload back, so pull the catalogue, append or edit the entry you are interested in and then put the entire object back.

The catalogue is one large object, not many small ones that combine.

Thanks for the update the Martin.
I understand that it is api for catalogue. Does Tyk has any RestAPI for creating/updating one or more API’s on portal catalogue?