My query is as follows, I have a rest API this is the url
( link ) and what I want is to make a GET
with a Json
.
Search the internet for examples with curl but I have never worked with that extension and I do not know if it goes in an html, I tried it and it clearly did not work, and in fact what I got was something worse:
My code is the following one, apparently at least I connected with the page, but it says to me:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 405.
What for now I understand that I do not have access to the api key. and the apikey is next, and I do not know where to add it.
102dc83bab93384369df4a6768f2fd9d
This is my code
HTML:
<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta charset="utf-8" />
<title>JSON</title>
</head>
<body>
<div id="summary"></div>
<button id="load-more" style="margin: 150px;" class="btn btn-color-2"> <i class="fa fa-refresh"></i>Cargar</button>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="js/prueba.js"></script>
</body>
</html>
JS:
$('#load-more').click(function(){
$.ajax({
url:'https://app.relojcontrol.com/api/consultaTurnos/consulta',
type:'GET',
dataType:'json',
})
.done(function(data){
console.log( data );
})
.fail(function(){alert("Fallo la carga");})
});
Thank you in advance.