AnsweredAssumed Answered

OPEN authentication required

Question asked by Tech Gaana on Mar 22, 2016
Latest reply on Mar 31, 2016 by Davey Shafik

Hi,

When we make call for purge cache over akamai. So we are getting below response. Please find code and akamai server response.

 

Request Call :-

 

function pap_akamai_purge($url){ // 'pap' stands for Php Akamai Purge 

        $append =array();

        $append["objects"]=$url;

        $postJsonValue= json_encode($append);

        $credentials = 'xxxx:xxxx' ;

        $pushUrl = "https://api.ccu.akamai.com/ccu/v3/delete/url/production";

        $rest = curl_init();

        curl_setopt($rest, CURLOPT_URL, $pushUrl);

        curl_setopt($rest, CURLOPT_USERPWD, $credentials);

        curl_setopt($rest, CURLOPT_CUSTOMREQUEST, "POST");                                                                  

        curl_setopt($rest, CURLOPT_POSTFIELDS, $postJsonValue);                                                               

        curl_setopt($rest, CURLOPT_RETURNTRANSFER, TRUE);

        curl_setopt($rest, CURLOPT_SSL_VERIFYHOST, 0);

        curl_setopt($rest, CURLOPT_SSL_VERIFYPEER, 0);

        curl_setopt($rest, CURLOPT_HTTPHEADER, array(

            'Content-Type: application/json',

            'client_token:XXXXX',

            'client_secret:XXXX',

            'access_token:XXXX',

            'base_url:XXXX',

            'Content-Length: ' . strlen($postJsonValue))                                                                    

        );

 

$response = curl_exec($rest);

        echo '<pre>1111111111111111';

        print_r($response);

        die;

 

}

     

Response Call :-

 

{

  "supportId": "17PY1458630997330332-535897280",

  "title": "OPEN authentication required",

  "httpStatus": 403,

  "detail": "Version 3 of the RESTful CCU API may only be accessed with {OPEN} authenentication.",

  "describedBy": "https://api.ccu.akamai.com/ccu/v2/errors/OPEN-authentication-required"

}

Outcomes