Recent searches


No recent searches

Getting Proxy error: Invalid request



Posted Mar 07, 2024

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 comments

image avatar

Tipene Hughes

Zendesk Developer Advocacy

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


Hi Team,

 

Thanks for the response.

In manifest i have updated the value like below.

 
 
But still facing the same issue in deployed private app.Kindly check below screenshot.
 
 
 
Kindly let us if know if there is any other options to schedule for call with team.It would helpful to resolve issue.
 
Thanks in advance
 
 

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

Thanks for the update, Pavithra.
 
One other thing to check, are you running the app locally or is it installed in your Zendesk instance?

0


Hi Tipene,

I have installed app in zendesk account and checking.

0


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


image avatar

Brett Bowser

Zendesk Community Manager

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


Please sign in to leave a comment.

Didn't find what you're looking for?

New post