The following forum(s) have migrated to Microsoft Q&A (Preview): Microsoft Partner Center API!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Facing problem in Partner Center API : Usage Data Collection For A Subscription RRS feed

  • Question

  • HI,

    I tried to call the following Partner Center API with proper parameters to collect the usage data for a subscription

    GET https://api.partnercenter.microsoft.com/v1/customers/{customer-tenant-id}/subscriptions/{id-for-subscription}/usagerecords/resources

    and the following Partner Center API with proper parameters to collect the usage summary for all of a customer's subscriptions.

    GET https://api.partnercenter.microsoft.com/v1/customers/{customer-tenant-id}/usagesummary

    But in both the cases, it returns the following error message:

    {
    "code": 1009,
    "description": "Authorization Failed",
    "data": [],
    "source": "PartnerFD"
    }

    I've double checked the all authentication parameters and found all parameters are Ok.

    Can you please tell me, why I am getting this kind of errors and what is the solution for this kind of error?

    Regards,

    Sougata Halder

    Sr Software Engineer

    Wednesday, April 5, 2017 7:22 AM

Answers

  • Hi Sougata,

    Due to the limitation of sandbox account, I would suggest you use a Primary Partner Center account to test this API at this moment.

    Best regards,

    Patrick Liang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, April 6, 2017 9:47 AM

All replies

  • Hi Sougata,

    What account you use in this test?

    By default, there is no usage data returned for the customers created by a Integration Sandbox account.

    Please use a Primary Partner Center Account to do the test again.

    Best regards,

    Patrick Liang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, April 6, 2017 3:03 AM
  • HI Patrick,

    Yes, We are calling the APIs for the customers, created by Sandbox account.

    Previously using CREST we can easily test the Azure usage collection API for the customers, created by Sandbox account, why not now?

    As per your comment, there is no usage data returned for the customers, that created through sandbox account. So can you please guide me that how can I test this API during our development process.

    Regards,

    Sougata

    Thursday, April 6, 2017 5:33 AM
  • Hi Sougata,

    Due to the limitation of sandbox account, I would suggest you use a Primary Partner Center account to test this API at this moment.

    Best regards,

    Patrick Liang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, April 6, 2017 9:47 AM
  • Thank you for your reply Patrick,

    Can you please tell me, if I need to get azure subscription usage of a customer for a specific dates (From date - To date), then What Partner Center API I should use?

    Currently using the following APIs what type of usage data we will get, it is cumulative data (adding all usage with starting from bill cycle start date to the date, when API call) or only data for the time instance , when that API call.

    GET https://api.partnercenter.microsoft.com/v1/customers/{customer-tenant-id}/subscriptions/{id-for-subscription}/usagerecords/resources

    GET https://api.partnercenter.microsoft.com/v1/customers/{customer-tenant-id}/usagesummary

    Regards,

    Sougata

    Tuesday, April 11, 2017 7:10 AM
  • Hi Sougata,

    To get the utilization records of a customer's Azure subscription for a specified time period, you can use this endpoint:

    https://msdn.microsoft.com/en-us/library/partnercenter/mt791774.aspx  

    Best regards,

    Patrick Liang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, April 13, 2017 2:15 AM
  • Is the conclusion that none of the customer usage samples can be run in the Sandbox environment?
    And why is the error authentication related?
    Regards

    Anders Houlberg-Nielsen


    IT Consultant

    Monday, August 14, 2017 8:46 AM