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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / custom API with custom...
Power Automate
Unanswered

custom API with custom connectors

(0) ShareShare
ReportReport
Posted on by 108

Hi

 

I am new to power app custom connectors - could you help with this ?

 

The call is successfully with javascript below but I don't know what settings I need to do for custom connectors (I did some tests with a public API and this is working just I don't know for this one below what I need to set)

 

 

async function fetchWebApi()

{

 

var details = {

    'userName': ‘username’,

    'password': 'password',

    'grant_type': 'password'

};

 

var formBody = [];

for (var property in details) {

  var encodedKey = encodeURIComponent(property);

  var encodedValue = encodeURIComponent(details[property]);

  formBody.push(encodedKey + "=" + encodedValue);

}

formBody = formBody.join("&");

 

let response = await fetch('http://XXXX/token', {

  method: 'POST',

  headers: {

    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'

  },

  body: formBody

})

 

let commit = await response.json();

 

console.log(commit);

 

console.log("Status " + response.status);

alert("Status " + response.status);

 

if (commit != null)

{

  console.log(commit.access_token);

  getAllClients(commit.access_token);

}

 

}

 

async function getAllClients(acessToken) {

 

  let response = await fetch('http://XXX:80/method', {

    headers: new Headers({

                             'Authorization': 'Bearer ' + acessToken,

                             'Content-Type' : 'application/x-www-form-urlencoded;charset=UTF-8'

              }),

    method: 'GET'

  })

 

  let result = await response.json();

 

  console.log(response);

  console.log(result);

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 207 Most Valuable Professional

#3
trice602 Profile Picture

trice602 185 Super User 2025 Season 2

Last 30 days Overall leaderboard