Using Tyk Gateway API


#1

Imported Google Group message. Original thread at: https://groups.google.com/forum/#!topic/tyk-community-support/n3n9DBulRZ4 Import Date: 2016-01-19 21:43:58 +0000.
Sender:Carlos Carvalho.
Date:Monday, 18 January 2016 15:00:26 UTC.

Hello,

I’ve been trying to create with nodejs an api to use tyk gateway rest api. I’m having difficulty on this because i need to create organizations and users and in you documentation I can’t see an example on how to do this.

Can you help me?

Thanks


#2

Imported Google Group message.
Sender:Martin Buhr.
Date:Monday, 18 January 2016 15:55:19 UTC.

Hi Carlos,

Check out the docs on the organisations API:

https://tyk.io/advanced-api-v0-9/organisations/

And the Admin Users API:

https://tyk.io/advanced-api-v0-9/admin-api-users/

Though we recommend that you only use these APIs to bootstrap an instance, then create Admin users taht are bound to organisations (see the quickstart shell script as part of our docker setup).

Cheers,
Martin

  • show quoted text -

  • show quoted text -


You received this message because you are subscribed to the Google Groups “Tyk Community Support” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/711b4f9b-dee7-440e-b21e-9d47f738178b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


#3

Imported Google Group message.
Sender:Carlos Carvalho.
Date:Monday, 18 January 2016 16:02:39 UTC.

Hum OK i will take a look then,

But the recommendation is because?

  • show quoted text -

#4

Imported Google Group message.
Sender:Martin Buhr.
Date:Monday, 18 January 2016 16:12:51 UTC.

Hi Carlos,

Because these admin-level APIs in the advanced APi are really raw, we only use them to bootstrap instances, everything else is done via a regular admin user within an organisation.

So the workflow is:

  1. Create organisation using Admin API
  2. Create User bound to organisation using Admin API (org ID is set) - API returns new users API token
  3. Use Org-level API token to do any further API creation / Policy management stuff

If you don;t do that, you will get un-bounded APIs and policies and might end up with some weird behaviour because Tyk where possible tries to enforce key/API and policy ownership. And superusers can create APIs and Policies that are unbound. It’s use-at-your-own-risk, basically.

Just fair warning :wink: If you use a bound API Dashboard user key, then everything will be ok, if not, there’s no guarantee.

Cheers,
Martin


#5

Imported Google Group message.
Sender:Carlos Carvalho.
Date:Monday, 18 January 2016 16:35:39 UTC.

OK thanks,

Not sure if I’ explained correctly but my final objective is to create a client api by using your api to be called whenever i need organizations and users. I will keep in mind the worklfow you just transcribe to me.

Thanks again

  • show quoted text -