You can access multiple APIs with a single key in TIBCO Mashery by adding all of those APIs to the same API package plan. Mashery issues keys per plan, not per API, so any application key created for that plan works on every API inside it. The steps are: create the API definitions, create one package and plan, add the APIs to the plan, publish I/O Docs for each API, issue a key from the developer portal and test both APIs with that key.
This is the cleanest way to give a partner or an internal team one credential for a group of related services, for example a product API and an order API that are always used together. This guide walks through the full setup in TIBCO Mashery API Management, explains how to check that it works, and lists the mistakes that most often block the second API.
Why use one key for several APIs
Managing one key per API quickly becomes messy: every new API means a new key request, a new approval and one more secret for the consumer to store. A shared plan key fixes that and gives you three clear benefits.
- One credential for the consumer, so integration code and key rotation stay simple
- One place to set rate limits and access rules for the whole group of APIs
- One set of usage reports, which makes it easier to see how a partner uses your services
Before you start
You need access to the Mashery Administrator portal and the developer portal of your area, at least two APIs that are already reachable from Mashery, and permission to create packages and plans. Keep the endpoint URLs and any test parameters handy, because you will use them in the final test.
Step 1: Create two API definitions
In the Mashery Administrator portal open Design, then API Definitions, and create a definition for each API with its endpoints and methods. For both definitions open Interactive Documentation Access Control and make sure the Everyone role is in the Current list. Without this, consumers cannot see the I/O Docs for that API later, and the second API will look like it is missing.
Step 2: Create one API package and one plan
Go to API Packages and create a new package, then open it and create a plan inside the package. The plan is the unit a key belongs to, so give it a clear name such as partner_plan. Set the Key Rate Limits here, for example calls per second and calls per day. These limits then apply to the key you issue, whichever API in the plan is called.
Step 3: Add both APIs to the plan
Open the Plan Designer for the plan. In the API Definitions panel select both APIs and add their endpoints to the plan, then save. This step is what makes one key valid for both APIs: only endpoints that are part of the plan accept its keys. Also open the plan Access Control and confirm the Everyone role is current, so developers can request keys for it.
Step 4: Generate I/O Docs for both APIs
Open Interactive Documentation and create an I/O Docs entry for each API definition. I/O Docs gives developers a test console that reads your API definition and lets them send real calls from the browser. Check that both entries appear in the list before moving on.
Step 5: Register an application and get the key
Now switch to the developer portal. Register or sign in as a developer, create an application, and request a key for the package. Tick the plan you created, for example Issue a new key for partner_plan, and submit. Depending on your approval settings the key is active immediately or after an administrator approves it. You will see the key and secret under your application.
Step 6: Test both APIs with the same key
In the developer portal open Interactive APIs and pick the first API in I/O Docs. Select your application key, fill in the parameters of a method (for example a product id), and press Try it. You should see the request URI with api_key in it and a 200 OK response. Then choose the second API from the same drop-down, keep the same key and run a method again. If the second call also returns 200, one plan key is working for both APIs.
How to confirm the key is really shared
Look at the request URI in the I/O Docs result: the api_key value should be identical for both APIs. You can also open traffic or key activity reports in the Administrator portal and check that calls to both APIs are logged under the same key.
Common problems and fixes
- The second API returns a key error: its endpoints are not added to the plan in the Plan Designer
- The API does not appear in I/O Docs: Interactive Documentation Access Control does not have the Everyone role
- No plan to choose when requesting a key: plan access control does not include the role of the developer
- Calls fail soon after starting: the plan rate limits are too low for your test, so raise them or wait for the window to reset
- Key is pending: the plan needs administrator approval before the key becomes active
Best practices
Group only APIs that belong together, because every API in the plan is reachable with the same key. Create separate plans for different tiers, such as a free plan with low limits and a paid plan with higher limits, and keep sensitive APIs in their own package. Review key usage regularly and rotate keys when a partner relationship ends.
Need help with API management?
Trishaksha Technologies designs and implements API management and integration on TIBCO Mashery, TIBCO Cloud, MuleSoft and Boomi for businesses in Saharanpur, Noida and across India. If you want a secure API program with clear plans, limits and reporting, contact us for a free consultation.
Frequently asked questions
Can one API key access multiple APIs in TIBCO Mashery?
Yes. Mashery keys belong to a plan, so one key works on every API whose endpoints are added to that plan in the Plan Designer.
What is the difference between an API package and a plan in Mashery?
A package is a bundle of APIs that you offer to developers, and a plan sits inside the package and defines which endpoints, rate limits and access rules apply. Keys are issued against a plan.
Why does my second API reject the key?
Most often the second API endpoints were not added to the plan. Open the Plan Designer, add them, save, and try again. Also check the I/O Docs and plan access control settings.
Do rate limits apply to each API separately?
Plan Key Rate Limits apply to the key, so calls to every API in the plan count against the same key limits. You can also set endpoint level limits if you need finer control.
Where can I test APIs before going live?
Use I/O Docs in the developer portal. It builds a test console from your API definition so you can send calls with your key and see the status code and response.
