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

0 comments

Sign in to leave a comment.

Didn't find what you're looking for?

New post