This domain has not been whitelisted

Hi 


In my manifest.json I have the following

 

{
  "platform-version": "2.0",
  "product": {
    "freshdesk": {
      "location": {
        "ticket_sidebar": {
          "url": "template.html",
          "icon": "icon.svg"
        }
      }
    }
  },
  "whitelisted-domains": [
    "https://xyz.freshdesk.com"
  ]
}

 

In the app.js I try to do a client.request.get

 

$(document).ready( function() {
    app.initialized()
        .then(function(_client) {
          var client = _client;
          client.events.on('app.activated',
            function() {
                client.data.get('ticket')
                    .then(function(data) {
						var api = "API_KEY:x";
						var headers = {"Authorization":  "Basic "+btoa(api) };
						var options = { "headers": headers, "Content-Type":"application/json" };
						var url = "https://xyz.freshdesk.com/companies/"+data.ticket.company_id;
						client.request.get(url, options)
						.then (
							function(returnData) {
								console.log(url);
								console.log(JSON.parse(returnData.response));
							},
							function(error) {
								for (p in error) {
									console.log("error:" + p); 
								}
								console.log(error.errorSource);
							});
                    })
                    .catch(function(e) {
                        console.log('Exception - ', e);
                    });
        });
    });
}); 

  

I've get a 400 error "This domain has not been whitelisted".


What is wrong?


Best regards,

Marco


2 people have this question

Would be great if someone could sheld some light on this.

Hello Marco,


The setup looks fine and you shouldn't get this error since you've mentioned the domain in the manifest.json file. Can you please retry the request and see if you're still seeing this error? Also, Can you please let us know the use-case that you're trying to achieve with the app?


Cheers!

I was struggling with the same situation in the test environment. I needed to restart the fdk server after updating the manifest file.

Hi,

I'm facing the same error.

I have this code in my app.js:
 client.data.get('contact')

      .then(function(data) {

        var base_url = "https://"+sub_domain+".od2.vtiger.com/"

        var url = base_url+"modules/Rest/Api.php/V1/Vtiger/Default/query?SELECT * FROM Contacts"        

        var headers = {"Authorization": "Basic "+btoa(user_name+":"+api_key) };

        var options = { "headers": headers, "Content-Type":"application/json" };

        console.log(url)

        client.request.get(url, options)

        .then(function(data){

          console.log("success");

        },

        function(err) {

          console.log(err)

        });



And this is my manifest:
{

  "platform-version": "2.0",

  "product": {

    "freshdesk": {

      "location": {

        "ticket_sidebar": {

          "url": "template.html",

          "icon": "icon.svg"

        }

      }

    }

  },

  "whitelisted-domains": [

    "https://<%= iparam.subdomain %>.od2.vtiger.com"

  ]

}


use

"whitelisted-domains": [

    "https://*.freshdesk.com"

  ]

Login or Signup to post a comment