How to use api dpd co uk api integration with php

0 votes

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?

Jun 2 in PHP by Kichu
• 19,040 points
13 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to Validate Form Data With PHP?

Hey @kartik, The first thing we will do ...READ MORE

answered Feb 13, 2020 in PHP by Niroj
• 82,720 points
1,243 views
0 votes
1 answer

What is a Cookie? How to create Cookies With PHP?

A cookie is often used to identify ...READ MORE

answered Feb 13, 2020 in PHP by Niroj
• 82,720 points
2,005 views
0 votes
1 answer

How to prevent XSS with HTML/PHP?

Hello, HTML Encoding htmlspecialchars will convert any "HTML special characters" ...READ MORE

answered Apr 1, 2020 in PHP by Niroj
• 82,720 points
469 views
0 votes
1 answer

How to detect search engine bots with php?

Hello, You can checkout if it's a search ...READ MORE

answered Apr 20, 2020 in PHP by Niroj
• 82,720 points
764 views
0 votes
1 answer

How to convert from MySQL datetime to another format with PHP?

Hello, To convert a date retrieved from MySQL ...READ MORE

answered May 19, 2020 in PHP by Niroj
• 82,720 points
807 views
0 votes
1 answer

How to Execute PHP function with onclick?

Hello @kartik, In javascript, make an ajax function, function ...READ MORE

answered Jun 16, 2020 in PHP by Niroj
• 82,720 points
16,826 views
0 votes
1 answer

Trying to call AWS API via PHP

Try using AWS SDK for PHP, Link ...READ MORE

answered Jun 6, 2018 in AWS by Cloud gunner
• 4,660 points
980 views
0 votes
1 answer

How to use Blockchain receive API without exchange rate?

Your code contains the amount in USD ...READ MORE

answered Aug 21, 2018 in Blockchain by Perry
• 17,100 points
291 views
0 votes
0 answers

Setting a Custom SEO Title Using Yoast Wordpress SEO API

I've just installed this plugin on my ...READ MORE

Mar 10 in Digital Marketing by Kichu
• 19,040 points
70 views
0 votes
1 answer

Currency Conversion using PHP

 An example of converting EUR to USD ...READ MORE

answered Mar 24 in Blockchain by Rahul
• 8,980 points
26 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP