Imported Google Group message.
Sender:Mathijs Van den Worm
.
Date:Thursday, 2 April 2015 15:39:39 UTC+1.
Hi Mathjis,
Sure thing, first off, there’s two API’s (confusing, I know!):
- The Tyk gateway REST API (this is documented here)
- The Advanced Management API (documented here)
Both API’s allow the same sort of thing (key management, API creation, etc.), however the gateway API is not granular and has a single access token (not good for a larger multi-team implementation, but good for direct integration into your own dashbaord etc.)
The second API is parcelled with the dashboard (and so is on a different port), to use this API you need to use the access token for the user that was created during setup, and the header is different.
Here’s a CURL sample for the gateway REST API:
curl http://HOST:PORT/tyk/keys/create
–header “x-tyk-authorization: ”
–data ‘{
“allowance”: 1000,
“rate”: 1000,
“per”: 60,
“expires”: 0,
“quota_max”: -1,
“quota_renews”: 1406121006,
“quota_remaining”: 0,
“quota_renewal_rate”: 60,
“access_rights”: {
“”: {
“api_name”: “My Test API”,
“api_id”: “”,
“versions”: [
“Default”
]
}
},
“org_id”: “”
}’
For the advanced API, you would use something that looked more like this:
curl http://HOST:PORT/api/keys
–header “authorization: ”
–data ‘{
“last_check”: 0,
“allowance”: 1000,
“rate”: 1000,
“per”: 60,
“expires”: 1430505313,
“quota_max”: -1,
“quota_renews”: 1427985366,
“quota_remaining”: -1,
“quota_renewal_rate”: 60,
“access_rights”: {
“b605a6f03cc14f8b74665452c263bf19”: {
“api_id”: “b605a6f03cc14f8b74665452c263bf19”,
“api_name”: “Tyk Test API”,
“versions”: [
“Default”
]
}
}
}’
So the first question would be, which API are you targetting?
Cheers,
Martin
On Thursday, April 2, 2015 at 3:27:39 PM UTC+1, Mathijs Van den Worm wrote:
Hi there,
I’ve been trying, but seem to be failing non stop, to use your API. As you’ve mentioned in the documentation “The Tyk REST API is the primary means for integrating your application with the Tyk API Gateway server.” The request seem to need more beside a X-Tyk-Authorization header. Could you help me by telling me what I need to send to the API to get a successful result?