locked
Is it possible to enumerate customers in the API? RRS feed

  • Question

  • Hi

    We have looked at the API documentation and done some testing in the sandbox environment where it's possible to get a single customer by Identity. Is there any way for us to get a list of all customers currently associated with out CSP tenant? The same list that is displayed under Customers in the partner center.

    Friday, May 15, 2015 10:38 AM

Answers

  • You can get a list of your customers using your AAD auth token and a call to the graph API.

    https://graph.windows.net/<tenantId>/contracts?api-version=1.5


    Phil Jirsa - Senior Consultant | Rackspace

    Thursday, July 30, 2015 11:31 AM

All replies

  • Currently there is no CREST API to get a list of all customers for a CSP tenant.
    • Proposed as answer by Ravi - MSFT Thursday, May 28, 2015 9:53 PM
    Thursday, May 28, 2015 6:24 PM
  • I expect this to be a key requirement for integration projects using the CREST API. Is this feature on a roadmap? Can we expect it in a later version?
    Wednesday, July 29, 2015 6:59 PM
  • You can get a list of your customers using your AAD auth token and a call to the graph API.

    https://graph.windows.net/<tenantId>/contracts?api-version=1.5


    Phil Jirsa - Senior Consultant | Rackspace

    Thursday, July 30, 2015 11:31 AM
  • The Graph API is the right way to do this. You'll have to grant permission to the App Id in the Azure portal first. Here's some additional pointers which may help.

    Reference documentation can be found here, code samples here, and the forum for help is here.

    Regards,
    Paul


    Saturday, August 1, 2015 12:43 AM
  • Is it possible to use graph api with Sandbox account for CSP? I always get "The identity of the calling application could not be established." when try to use sandbox account

    Pankaj Rana

    Thursday, September 24, 2015 6:09 PM
  • Is it possible to use graph api with Sandbox account for CSP? I always get "The identity of the calling application could not be established." when try to use sandbox account

    Pankaj Rana

    Hi Pankaj,

    Check the App Id in an Azure subscription to see that it has appropriate permissions and is set as a multi-tenant application.

    Regards,
    Paul

    Friday, September 25, 2015 4:09 AM
  • Thanks for your response Paul. I tried authentication with production account api it worked fine. But I can't get list of customers. Here is my case.

    1. I have CSP account.

    2. Created API key.

    3. I have one customer in CSP but no subscriptions for customer yet.

    4. I tried to get contacts (I think contact is customer) using api (https://graph.windows.net/cspSynoptek.onmicrosoft.com/contacts?api-version=1.6)

    5. I get response but list is empty. I can get users successfully or contact detail successfully. 

    Can you please help get list of CSP customer? 


    Pankaj Rana

    Friday, September 25, 2015 5:56 PM
  • 4. I tried to get contacts (I think contact is customer) using api (https://graph.windows.net/cspSynoptek.onmicrosoft.com/contacts?api-version=1.6)

    Use this API https://graph.windows.net/<partner-tenant-id-or-domain>/contracts?api-version=1.6

    Test it out with the graph explorer: http://graphexplorer2.cloudapp.net/

    More docs here: https://msdn.microsoft.com/Library/Azure/Ad/Graph/api/entity-and-complex-type-reference#ContractEntity

    You can use standard Graph pagination if there are too many contract objects to manage. Pagination is documented here (https://msdn.microsoft.com/en-us/library/azure/dn727074.aspx).

    Paul

    Monday, September 28, 2015 5:14 AM
  • Hi!

    correct me if I am wrong but I cannot see an Azure subscription if customer removed my permissions from this subscription?

    Thursday, October 1, 2015 11:42 AM