Use either an access token or a connected application for authentication.
You only need authentication if you are searching for assets that are not created by MuleSoft.
To use token authentication:
-
Log in to Anypoint Platform.
-
Obtain an access token with a cURL command.
You can also use Postman or another application for sending HTTP commands.
Replace ANYPOINT_USERNAME with your Anypoint Platform user account name and replace ANYPOINT_PASSWORD with your password.
curl --location --request POST 'https://anypoint.mulesoft.com/accounts/login' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"username":"ANYPOINT_USERNAME",
"password":"ANYPOINT_PASSWORD"
}' | jq -r ".access_token"
Use this access token in your API calls.
Your organization administrator sets the expiration time for access tokens to a value from 15 to 180 minutes. If you perform a search or other operation that requires more time, you must request an additional token.
To use connected application authentication:
-
Create a connected application.
-
Choose whether to use basic authentication or query variable authentication.
If both basic authentication and query variable authentication are set, the API uses basic authentication and ignores the query variable authentication.
-
To use basic authentication, provide basic authentication and define the username as ~~~Client~~~ and the password as clientID~?~clientSecret.
-
Replace clientID with the client ID.
-
Replace clientSecret with the client secret.
-
To use query variable authentication, define the connected application authentication as an authorization field in the query variables:
{
"authorization": "Basic ABC123"
}
Replace ABC123 with the base64 encoding of the concatenated client ID and client secret: ~~~Client~~~:clientID~?~clientSecret