Domainr

FREEMIUM
Verified
By Domainr | Updated 24 days ago | Business
Popularity

9.9 / 10

Latency

420ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Getting 500 error on call

Rapid account: Edsonsantoro
edsonsantoro
8 years ago

Trying to call a search request but I’m getting this error message:

XMLHttpRequest cannot load https://domainr.p.mashape.com/v2/search?query=test. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://santoro.studio’ is therefore not allowed access. The response had HTTP status code 500.

Rapid account: Edsonsantoro
edsonsantoro Commented 8 years ago

Sorry, don’t know what is it …

Rapid account: Domainr
domainr Commented 8 years ago

Have you tried including the callback parameter? This is also described in our documentation: “To query the Domainr API from a browser that does not support CORS, you can request a JSONP response by including the callback parameter with the name of a JavaScript function to call in any API URL.”

Rapid account: Edsonsantoro
edsonsantoro Commented 8 years ago

It’s included, but I’m calling this using Ajax example from Mashape Blog

Here is an example :

<pre>
$.ajax({
url: 'https://domainr.p.mashape.com/v2/search?query=testing, // The URL to the API. You can get this by clicking on “Show CURL example” from an API profile
type: ‘POST’, // The HTTP Method
data: {}, // Additional parameters here
datatype: ‘json’,
success: function(data) { alert(JSON.stringify(data)); },
error: function(err) { alert(err); },
beforeSend: function(xhr) {
xhr.setRequestHeader(“X-Mashape-Authorization”, “Entered my key here”); //
}
});
</pre>

Including or not the key on URL doesn’t worked too…
Removing <code>beforeSend: function(xhr) … </code> doesn’t work …

Already make calls using ajax with different APIs, and it works…

Rapid account: Domainr
domainr Commented 8 years ago

Hello,

The example query in our authentication documentation shows that you need include the ?mashape-key={your-Mashape-API-key} query parameter in your request.

-Eric

Join in the discussion - add comment below:

Login / Signup to post new comments