Using Postman to Hit an API Management Endpoint with Subscription

2 Comments

In our previous posts, we created an App Service and an API Management in Azure. Let’s now use Postman to send a request to the Azure API Management endpoint.

Go to the APIM and select the API. Under Settings, copy the Base URL:

Now, in our case, we have /api/Customers to get all customers:

So our URL is https://crmdevapim.azure-api.net/api/customers.

Let’s open Postman and create this request. Click Send:

We get a response back:

Now these tests are without a subscription. Let’s try this with a Subscription:

If we rerun our Postman request, we get a 401 Access Denied – { “statusCode”: 401, “message”: “Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API.” }:

In the header in Postman, we will pass the Ocp-Apim-Subscription-Key key. To get the key value, go to the APIM Subscriptions:

Resend the request and you will get back a response:

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

2 Responses to Using Postman to Hit an API Management Endpoint with Subscription

  1. Hello Carl and thanks for your simple and quick tutorial.

    But how you get the Ocp-Apim-Subscription-Key value? It is “overlapped” in my APIM, and I cannot copy it.

    Regards and thanks in advance for your answer.

  2. Thank you Carl, I have just found the answer to my previous question about get the key value for subscription.

Leave a Reply

Your email address will not be published. Required fields are marked *