This doc explains technical details about using the Partnership API. For an introduction and requirements, first read Intro to Partnership API.
Requirements
The Partnership API is not available to your organization unless you're specifically instructed by your New Relic representative that you should use it.
For requirements, see Intro to Partnership API.
Find your Partnership API key
The Partnership API requires that you authenticate with the REST API key that is specific to your partnership owner account (you cannot use the other REST API keys).
When using your Partnership API key with calls to REST API (v2) endpoints that require the use of an Admin user's API key, see Admin user's API Key and partnerships.
Find your Partner ID
The Partnership API also requires that you authenticate by providing a Partner ID specific to your partnership. This is unique from the account ID for your partnership owner account.
To obtain your Partner ID, go to your partner admin console and retrieve the partner ID number that is listed in your URL:
https://partner-admin-console.newrelic.com/accounts/$ACCOUNT_ID/admin_console/partnerships/$PARTNER_ID
You must include the Partner ID as part of the base URL for the Partner API.
URL component | URL pattern |
---|---|
Partner API endpoint |
|
Resource URL patterns |
|
Example |
|
Authenticate the API call
To authenticate to the Partner API when making an API call:
- Add a request header labeled x-api-key and set its value to your Partner API key.
- Include your Partner ID at the specified point in the request URI.
Notes for partners who manage New Relic accounts
For partners who manage New Relic accounts for their customers, the initial API call for all account-level interactions is to "create account." This call returns an xml record of the newly created account. Part of this record is the account_id
. All of the other calls in the Partnership API require the account_id
as a parameter. Provision will need to be made by the partner to parse the returned xml extract, store the account_id
, and associate it with the users' partner account record.
Errors
New Relic uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx
range indicate success and codes in the 4xx
range indicate an error that resulted from the provided information (for example, a required parameter was missing).
Error | Probable cause |
---|---|
400 Bad Request | Most commonly the call is missing a required parameter. |
401 Unauthorized | A valid API key was not provided. |
402 Request Failed | Parameters were valid but request failed for some reason. |
404 Not Found | The requested item doesn't exist. |
422 Unprocessable Entity | Your account has special terms and cannot be changed. |