I have been assigned the task of integrating a shipping company's API with a client's website and I want to know about its API documentation. I have the pdf that client has shared but I am not able to understand that much from it.
The code I tried:
$url="api.dpd.co.uk/user/?action=login HTTP/1.1";
$options = array(
'http' => array(
'method' => 'POST',
'Host' => 'api.dpd.co.uk',
'method' => 'POST',
'header'=> "Content-Type: application/json\r\n" .
"Accept: application/json\r\n".
"Authorization: Basic RFNNSVRIOk1ZUEFTU1dE".
"GEOClient:".base64_encode("account/123456").
"Content-Length: 0"
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$response = json_decode($result);
echo var_dump($response);
Can someone help me with this?