I'm working on a custom connector that uses an API key query parameter for authentication. All of the actions use this parameter with one exception where the API key has to be passed as part of the POST body. Does anyone know of a way to remove the query parameter from the request or override the URL? I found Vivek's code from the Shopify connector (https://github.com/thatapiguy/PowerPlatformConnectors/blob/Shopify-Admin/independent-publisher-connectors/Shopify%20Admin%20Store/script.csx), but that is to add a header. I'm not familiar with the rest of System.Net.HTTP (System.Net.Http Namespace | Microsoft Docs) that should be doable in custom code.
I was finally able to get this working, just not using custom code. I ended up using a policy to set the query string parameter (for every other action) and used a @connectionParameter. After downloading the connector using paconn, I added the connectionParameter in apiProperties.json:
{
"properties": {
"connectionParameters": {
"API Key": {
"type": "string",
"uiDefinition": {
"constraints": {
"required": "true"
},
"description": "Please enter your API Key.",
"displayName": "API Key"
}
}
},
"iconBrandColor": "#da3b01",
"scriptOperations": [
"AccessTokenGet"
],
"capabilities": [],
"policyTemplateInstances": [
{
"templateId": "setqueryparameter",
"title": "Set API Key",
"parameters": {
"x-ms-apimTemplateParameter.name": "api_key",
"x-ms-apimTemplateParameter.value": "@connectionParameters('API Key')",
"x-ms-apimTemplateParameter.existsAction": "override",
"x-ms-apimTemplate-operationName": [
"ProjectInformationGet",
"ProjectInformationSetIDs",
"CampaignProjectGet",
"CampaignSummaryProject",
"ProjectCountryGet",
"ProjectSummaryCountry",
"ProjectTheme",
"ProjectThemeSummary",
"ProjectOrganization",
"ProjectOrganizationSummary",
"ProjectGet",
"ProjectSummaryGet",
"ProjectIDs",
"ProjectFeatured",
"ProjectFeaturedSummary",
"ImageGallery",
"OrganizationGet",
"OrganizationGetAll",
"InvoiceOutstanding",
"ThirdPartyMax",
"ProjectRegionCount",
"RegionProjectCount",
"RegionGet",
"ProjectGetA",
"ProjectSummary",
"Themes",
"ThemeProject",
"ProjectSearch",
"DonationSubmit",
"GiftCardDesigns",
"GiftCardSend",
"GiftCertificateOrder",
"GiftCertificateDetails"
]
}
}
],
"publisher": "Troy Taylor"
}
}
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1