I have a website and to enter it needs to log in, and the data is: cpf and email. And I have an API that I need to play the cpf and email variables to be parameters in the api, but I do not have much knowledge in api and also just have the link to it.
I need to play this data because each user will have different data, and api will need this data in the parameter to make a select and search the data of the person registered with cpf and email.
eg link
Consuming API:
function load(){
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://api/api/TRCKCLICODCPF=12345678901&EMAIL=fulano%40email.com");
xhr.addEventListener("load", function() {
var resposta = xhr.responseText;
// console.log("ola1");
var clientes = JSON.parse(resposta);
// console.log("ola2");
// console.log(clientes);
for (var i =0; i < 1; i++){
// console.log("ola3");
var clientes_1 = clientes.TRACKER[i];
AdicionaNome(clientes_1);
AdicionaCPF(clientes_1);
AdicionaProduto(clientes_1);
AdicionaCidade(clientes_1);
AdicionaCodigoProduto(clientes_1);
AdicionaCodigoCliente(clientes_1);
AdicionaStatus(clientes_1);
ActiveStatusImage(clientes_1);
ActiveOnlyPostagem(clientes_1);
adicionaClienteNaTabelaViagem(clientes_1);
ActiveQtdViagem(clientes_1);
}
});
xhr.send();
}
window.onload = load;
I've changed the api link, just an example