Get partners of a customer
Applies to: Partner Center
How to get a list of the indirect resellers or indirect providers who have a relationship with a specified customer.
Prerequisites
Be actively enrolled in the CSP program as an indirect provider or indirect reseller.
Credentials as described in Partner Center authentication. This scenario supports authentication with App+User credentials only.
A customer ID (
customer-tenant-id
). If you don't know the customer's ID, you can look it up in Partner Center. Select the Customers workspace from the Partner Center Home page. Select the customer from the Customer list, then select Account. On the customer's Account page, look for the Microsoft ID in the Customer Account details section. The Microsoft ID is the same as the customer ID (customer-tenant-id
).
C#
To retrieve a list of indirect resellers, or indirect providers, with whom the specified customer has a relationship, first get an interface to customer collection operations for the specific customer from the partnerOperations.Customers property by providing the customer ID to identify the customer. Then call the Relationships.Get or Get_Async method to get the list of indirect resellers.
// IAggregatePartner partnerOperations;
// string customerId;
var partnerRelationships = partnerOperations.Customers[customerId].Relationships.Get();
REST request
Here's the REST request and response information.
Request syntax
Method | Request URI |
---|---|
GET | {baseURL}/v1/customers/{customer-id}/relationships HTTP/1.1 |
URI parameter
Use the following path parameter to identify the customer.
Name | Type | Required | Description |
---|---|---|---|
customer-id | string | Yes | A GUID formatted string, which identifies the customer. |
Request headers
For more information, see Partner Center REST headers.
Request body
None.
Request example
GET https://api.partnercenter.microsoft.com/v1/customers/c501c3c4-d776-40ef-9ecf-9cefb59442c1/relationships HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: c9251710-5a30-4cd3-891a-c42d550af9a8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
Host: api.partnercenter.microsoft.com
REST response
If successful, the response body contains a collection of PartnerRelationship resources to identify the resellers.
Response success and error codes
Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters. For the full list, see Partner Center error codes.
Response example
HTTP/1.1 200 OK
Content-Length: 264
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: c9251710-5a30-4cd3-891a-c42d550af9a8
MS-CV: plJP3ufU0UqXMeuh.0
MS-ServerId: 020021921
Date: Fri, 07 Apr 2017 23:42:11 GMT
{
"totalCount": 1,
"items": [{
"id": "aaaa0000-aa11-2222-33cc-444444bbbbbb",
"name": "First Up Consultants",
"relationshipType": "is_indirect_cloud_solution_provider_of",
"mpnId": "4847383",
"attributes": {
"objectType": "PartnerRelationship"
}
}
],
"attributes": {
"objectType": "Collection"
}
}