cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Buddy2019
Helper I
Helper I

Custom Connectors - how to pass parameters

I am trying to create my own custom connector using Microsoft Graph API Get free/busy schedule of users and resources. https://docs.microsoft.com/en-us/graph/outlook-get-free-busy-schedule The API is working correctly and is able to connect to the MS accounts when I tested it in Postman.  In Postman I was able to create variables where I can change the values (image below). I would like to apply this same type of logic with the PowerApps custom connectors. In a post request, how can I create variables so that whoever is using the PowerApps connector can change the parameters like email address, time and so on ? Currently the values are all hard coded and I would like the PowerApps user to be able to add their own information instead.  If I go into Action > Request >import from sample, I don't see a way to add place holders. 

Postman.PNG

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
DavesTechTips
Super User
Super User

Hi @Buddy2019 

 

As far as I am aware variables can only be used for connection related settings.

 

The details you send to graph can be specified as in the action definitions which will allow the custom connector to place it in the header of body of the request at the time of querying the API.

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.

 

 

View solution in original post

7 REPLIES 7
seadude
Memorable Member
Memorable Member

Hi @Buddy2019 ,

I'd love to help but I can't figure out how to get Postman to play nicely with the auth tokens!

Tried this and this, no avail. Various errors when trying to run a `getSchedule` POST call, including

```

{
"error": {
"code": "NoPermissionsInAccessToken",
"message": "The token contains no permissions, or permissions can not be understood.",
"innerError": {
"request-id": "d387f191-c31f-4714-a914-438890543ecb",
"date": "2019-08-24T07:08:02"
}
}
}

```

 

DavesTechTips
Super User
Super User

Hi @Buddy2019 

 

As far as I am aware variables can only be used for connection related settings.

 

The details you send to graph can be specified as in the action definitions which will allow the custom connector to place it in the header of body of the request at the time of querying the API.

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.

 

 

I recently found some new functionality you guys might be interested in with regards to Custom Connectors. Something known as "path templating". This allows you to pass variables that are in the path of the url to Custom Connectors.

Example:

How to do it:

  • In Postman, create the URL as follows: https://myapi.com/v3/:username/:thing
  • Export the Collection from Postman (as V1 deprecated)
  • Import the Collection into PowerApps as a new Custom Connector

Not sure this is what you were looking for, but I know @DavesTechTips might appreciate it anyways!

Cheers!

Thank you @seadude

 

There is also new functionality available that we have used while certifying a connector for a 3rd party called policies.

https://docs.microsoft.com/en-us/power-platform-release-plan/2019wave2/cdm-data-integration/support-...

 

Works quite well, and I am sure that it will get even better going forward.

seadude
Memorable Member
Memorable Member

To follow up here a number of years later...

There is an easier way to pass parameters in the URL. When creating a Custom Connector, use "{}" in the path for each dynamic parameter. 

 

**Example:**

https://test.com/api/{version}/{parameter1}/test

This is exactly what I have been looking for over the last 2 hours, thank you for sharing your solution!

 

Do you know how to change the order of the parameters?

In your example: https://test.com/api/{version}/{parameter1}/test How do you get the UI to show them like this when entering the values?

parameter1

version

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,218)