locked
{ "statusCode": 401, "message": "Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API." } RRS feed

  • Question

  • Hi,

    I have created an API management resource. but when i try to access API using API management portal.

    it. gives me below response.

    Content-Type: application/json { "statusCode": 500, "message": "Internal server error", "activityId": "95c38f1d-1f1d-4277-bdc2-53e634d09129" }

    I ran the API URL separately then its throws error messages like

    { "statusCode": 401, "message": "Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API." }

    Here I am also passing the product subscription key as well in request:

    

    please suggest for the same

    Saturday, September 22, 2018 11:07 AM

All replies

  • Looks like you have enabled the option to Require subscription for the product settings, try to pass the header “Ocp-Apim-Subscription-Key” and see if it helps. If you don't want the subscription option, disable it in the product settings.

    Note: Always try to add your API to your product, or you might get error. The key should belong to the product which the API includes.

    ------------------------------------------------------------------------------------------------------If this answer was helpful, click “Mark as Answer” or Up-Vote. To provide additional feedback on your forum experience, click here

    • Proposed as answer by Swikruti Bose Sunday, September 23, 2018 2:22 AM
    Sunday, September 23, 2018 2:22 AM
  • Make sure are you passing correct subscription-key,

    If you have Developer portal access check the subscription key in Profile->Your subscriptions section

    If you dont want use subscription base api then created product called Subscriptionless product and

    assign the api to that product

    Tuesday, September 25, 2018 1:14 AM
  • Checking in to see if the above answer helped to solve your problem. Let us know if there are still any additional issues we can help with.
    Tuesday, September 25, 2018 7:57 AM