I am trying to authenticate, the result of my request is returned incorrectly.
Request Model
Method: Post, Endpoint: /api/authenticate, Header Variables: [{"key":"Content-Type","value":"application/json","enabled":true}], Body Parameters: username: string, password: string, authenticationType: string
Sample Request
POST /api/authenticate
Host: mpop-sit.hepsiburada.com
Content-Type: application/json
{
"username": "xyz_dev",
"password": "XYZ_dev123!",
"authenticationType": "INTEGRATOR"
}
Request i sent
$url = 'https://mpop-sit.hepsiburada.com//api/authenticate';
$ch = curl_init($url);
$header = array(
'Content-Type: application/json',
'Authorization: Bearer '. base64_encode('xyz_dev:XYZ_dev123!:INTEGRATOR'),
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$result = curl_exec($ch);
$return=json_decode($result,true);
print_r($return);
This is the result of the query returned and the error I received. Where do you think I might be making a mistake?
Array ( [timestamp] => 2020-02-07T09:01:47.426+0000 [status] => 500 [error] => Internal Server Error [exception] => io.jsonwebtoken.MalformedJwtException [message] => JWT strings must contain exactly 2 period characters. Found: 0 [path] => //api/authenticate )