It’s a bit difficult to test against as usually the API key is in the header. Without the full spec of what they are expecting, it’s difficult to give an example.
With PlayCanvas REST API we expect the header to have the following format for a get request https://developer.playcanvas.com/en/user-manual/api/app-get/:
pc.http.get(
'https://playcanvas.com/api/projects/725725/app',
{
headers: {
// header here
'Content-Type': 'application/json',
"Authorization": "Bearer API_KEY_STRING"
}
},
function (err, response) {
console.log(err);
console.log(response);
}
);
Where as Swagger expects https://swagger.io/docs/specification/authentication/api-keys/
pc.http.get(
'https://someswaggerapi',
{
headers: {
// header here
"X-API-Key": "abcdef12345"
}
},
function (err, response) {
console.log(err);
console.log(response);
}
);
Based on what you have written, I’m going to guess it’s the following
pc.http.get(
'https://apipronidev.potencia.mx/api/v1/quizzes-results',
{
// data here
"data": {
"attributes": {
"correct_answers": 0,
"module": 0,
"student_id": 0,
"type_quiz": "grade_exam"
}
}
},
{
headers: {
// header here
"Content-Type": "application/json",
"apikey": "abcdef12345"
}
},
function (err, response) {
console.log(err);
console.log(response);
}
);
Or
pc.http.get(
'https://apipronidev.potencia.mx/api/v1/quizzes-results',
{
// data here
"data": {
"attributes": {
"correct_answers": 0,
"module": 0,
"student_id": 0,
"type_quiz": "grade_exam"
}
}
},
{
headers: {
// header here
"Content-Type": "application/json",
"Authorization": "abcdef12345"
}
},
function (err, response) {
console.log(err);
console.log(response);
}
);