web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / 502 Error When Trying ...
Power Automate
Unanswered

502 Error When Trying to Access an Apigee Endpoint Through HTTP Request for API Key

(0) ShareShare
ReportReport
Posted on by 18
I keep getting a 502 error when trying to access an Apigee endpoint for an API key using an HTTP request. I have confirmed that the URI is functional and gives an API key when using postman. Below are example attempts for what I have tried to get working.
{
    "uri": "(confirmed working)",
    "method": "POST",
    "headers": {
        "Content-Type": "application/x-www-form-urlencoded"
    },
    "retryPolicy": {
        "type": "None"
    },
    "authentication": {
        "username": "*sanitized*",
        "password": "*sanitized*",
        "type": "Basic"
    },
    "body": "grant_type=client_credentials"
}
and
{
    "uri": "(confirmed working)",
    "method": "POST",
    "headers": {
        "Content-Type": "application/x-www-form-urlencoded"
    },
    "retryPolicy": {
        "type": "None"
    },
    "body": "grant_type=client_credentials&client_id=*sanitized*&client_secret=*sanitized*"
}
and
{
    "uri": "(confirmed working)",
    "method": "POST",
    "headers": {
        "Content-Type": "application/x-www-form-urlencoded"
    },
    "retryPolicy": {
        "type": "None"
    },
    "body": {
        "grant_type": "client_credentials",
        "client_id": "*sanitized*"
        "client_secret": "*sanitized*"
    }
}
The 502 error is always of the form
{
    "statusCode": 502,
    "headers": {
        "Date": "Thu, 12 Feb 2026 15:43:07 GMT",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "x-ms-islandgateway": "_prdil108wusgb0_2",
        "x-ms-igw-tracking-id": "405e6747-ee53-4467-950c-f726771115b920260212154307_prdil108wusgb0_2",
        "mise-correlation-id": "2f4134a2-94fd-489b-9833-c23b14408569",
        "Server-Timing": "x-ms-igw-upstream-headers;dur=83.2,x-ms-igw-req-overhead;dur=0.8",
        "X-Content-Type-Options": "nosniff",
        "x-ms-service-request-id": "405e6747-ee53-4467-950c-f726771115b9",
        "x-ms-correlation-id": "7d57183d-eb28-4468-9892-fe9f6eca155e",
        "x-ms-activity-vector": "00.00.IN.05.IN.0I.00",
        "Content-Length": "0"
    }
}
I'm not sure what the issue is or how to go about attempting to fix it, the rest of the process is built up in power automate and I need to use it.
Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard