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, 2022 in PHP by Kichu
• 19,050 points
545 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,880 points
2,884 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,880 points
3,414 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,880 points
899 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,880 points
1,166 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,880 points
2,935 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,880 points
21,515 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,670 points
1,465 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
579 views
0 votes
1 answer

Setting a Custom SEO Title Using Yoast Wordpress SEO API

Firstly disable WordPress SEO by Yoast, then ...READ MORE

answered Mar 11, 2022 in Digital Marketing by narikkadan
• 63,420 points
917 views
0 votes
1 answer

Currency Conversion using PHP

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

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