oauth2 - necesito recibir el token de la api de abanca
Publicado por alex (1 intervención) el 03/03/2021 16:57:22
Hola a todos,
Alguien me puede ayudar. necesito recibir el token de la api de abanca y me da error. Este es el codigo
segun la banca este es el procedimiento
me regresa este error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Alguien me puede ayudar. necesito recibir el token de la api de abanca y me da error. Este es el codigo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$idcliente="xxxxx";
$APIkey="xxxxxx";
$code="22222222";
$scope="3333";
$url="https://api.abanca.com/sandbox/oauth2/token";
$parametros = [
'grant_type' => 'authorization_code',
'APLICACION' => $idcliente,
'code'=>$code
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $parametros,
CURLOPT_HTTPHEADER => array(
"content-type: application/x-www-form-urlencoded",
"AuthKey:" .$APIkey
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo "resultado <br><br>" ;
echo $response;
}
echo('<br>');
?>
segun la banca este es el procedimiento
1
2
3
4
5
6
POST /oauth2/token HTTP/1.1
Host: {servidor api}
Content-Type: application/x-www-form-urlencoded
AuthKey: {api key}
grant_type=authorization_code
&APLICACION={id cliente}&code={authorization code}
me regresa este error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Valora esta pregunta


0