最近搜索
没有最近搜索
Getting Proxy error: Invalid request
已于 2024年3月07日 发布
Hi Team,
I am encountering the error "Proxy error: Invalid request" when attempting to create a request to a third-party server.
Manifest code:
{
"name": "Sample App",
"author": {
"name": "Company1",
"email": "support@test.in",
"url": "https://test.in"
},
"defaultLocale": "en",
"private": false,
"location": {
"support": {
"ticket_sidebar": {
"url": "assets/iframe.html",
"flexible":true,
"size": {
"width": "450px",
"height": "1500px"
}
}
}
},
"parameters": [
{
"name": "Zendeskurl",
"type": "url",
"required": true,
"secure": false
},
{
"name": "Zendeskemail",
"type": "text",
"required": true,
"secure": false
},
{
"name": "Zendesktoken",
"type": "password",
"required": true,
"secure": true
}, {
"name": "Azuredevopsurl",
"type": "url",
"required": true
},
{
"name": "Azuredevopstoken",
"type": "password",
"required": true,
"secure": true
}
],
"domainWhitelist": ["{{setting.Zendeskurl}}","{{setting.Azuredevopsurl}}"],
"version": "1.0",
"frameworkVersion": "2.0"
}
Request:
var option = {
type: "GET",
url: "" + azure_url + "/_apis/projects?api-version=6.0",
headers: {
Authorization: `Basic x:{{setting.Azuredevopstoken}}`,
},
accepts: "application/json",
dataType: 'json',
contentType: "application/json-patch+json",
secure: true,
}
client.request(option).then(
function (response) {
console.log("response",response);
},
function (error) {
console.log("error:", error);
}
Previously, we were using btoa to encode the API key, and it was working fine.
However, since it is recommended to use secure settings for submitting the app in the marketplace, attempting secure settings throws us an error both locally and in the deployed private app. The Azure API only accepts encoded API keys.
Kindly assist us in resolving this issue.
0
6
6 条评论
Tipene Hughes
Hi Pavithra,
I noticed you're attempting to use secure settings within the manifest file, specifically, under the domainWhitelist property. This is likely causing issues since the setting values won't be inserted by the Zendesk proxy here. To start, I'd suggest updating the domainWhitelist URLs to the correct string values and try again.
Let me know if you have any questions.
Tipene
0
Pavithra Selvaraj
Hi Team,
Thanks for the response.
In manifest i have updated the value like below.
0
Tipene Hughes
One other thing to check, are you running the app locally or is it installed in your Zendesk instance?
0
Pavithra Selvaraj
Hi Tipene,
I have installed app in zendesk account and checking.
0
kami
Gratitude for the update, Pavithra.
Another thing to check, would you say you are running the application locally or is it introduced in your Zendesk occurrence?
0
Brett Bowser
Hey Pavithra Selvaraj , a little late to the party here but another user wanted to point out that the problem is the trailing backslash "/" that was added after the whitelist address. Hope this helps!
0