Loading

How to obtain all client ids and secrets associated with an API Application

Fecha de publicación: Jul 25, 2025
Tarea

GOAL

This KB covers the steps required to obtain Client ids and Secrets of Client application subscribed to API Application.
Pasos
We don't have a single API that can be used to get all the Client ids and Secrets, but you can achieve it by using following sequence. 
In order to get Client Id and Secret of a client Applications; you need to perform following steps: 
 
1- You will need to obtain an org admin token using How to generate your Authorization Bearer token for Anypoint Platform KB.

2- You will need to obtain your organization id using How to know my Organization ID (Org ID) on the Anypoint Platform KB.

3- Make a call to following API to get list of applications and their versions: 
GET /organizations/{organizationId}/apis 
*note: you need to find apiId and version id in this request. You need to look for Versions under each api, as following:
"versions": [
                {
                    "audit": {
                        "created": {
                            "date": "2016-10-06T21:56:11.294Z"
                        },
                        "updated": {
                            "date": "2016-10-06T21:56:29.650Z"
                        }
                    },
                    "masterOrganizationId": "MASTER_ORG_ID",
                    "organizationId": "ORGANIZATION_ID",
                    "id": 12345,     <---- this is versionId
                    "apiId": 78995,  <---- this is apiId

Sample curl command:
curl -v -H "Authorization: Bearer [YOUR_ACCESS_TOKEN] -X GET "https://anypoint.mulesoft.com/apiplatform/repository/v2/organizations/{orgId}/apis"

4- Make a call to following api to get list of client applications (contracts) subscribed to your API Application for the apiId and versionId that you've obtained in step 3 : 
GET /organizations/{organizationId}/apis/{apiId}/versions/{apiVersionId}/contracts 
*note: You need to find applicationId of each contract in response.

Sample curl command:
curl -v -H "Authorization: Bearer [YOUR_ACCESS_TOKEN] -X GET "https://anypoint.mulesoft.com/apiplatform/repository/v2/organizations/{organizationId}/apis/{apiId}/versions/{apiVersionId}/contracts"
 

5- Now you can use applicationId from step 4 and get client ID and secret by calling following API: 
GET /organizations/{organizationId}/applications/{applicationId} 
*note: now you can find clientId and clientSecret in response.

Sample curl command:
curl -v -H "Authorization: Bearer [YOUR_ACCESS_TOKEN] -X GET "https://anypoint.mulesoft.com/apiplatform/repository/v2/organizations/{organizationId}/applications/{applicationId}

NOTE

You can refer to API Portal for the complete list of APIs that you can use.
Número del artículo de conocimiento

001115031

 
Cargando
Salesforce Help | Article