AnsweredAssumed Answered

CCU API - Invalidation via Curl in Command Line

Question asked by Cassius John-Adams on Sep 8, 2015
Latest reply on Sep 9, 2015 by Trevor Ng

I'm struggling to understand the basics of the way that a header needs to be formed in order for the API to authenticate me.  I will need to perform some cache invalidations via CURL using the CCU v2 API, but so far I'm only getting an error stating "The authorization header does not have the right format"

 

I may have a fundamental misunderstanding of how this should work.

 

Right now, my curl statement looks something like this:

=================

curl --include \

     --request POST \

     --header "Content-Type: application/json" \

     -H "Authorization: EG1-HMAC-SHA256 \

        client_token=akab-******************; \

        access_token=akab-******************; \

        timestamp=20150908T20:05:23+0000; \

        nonce=randomly-made-up-text; \

        secret=*********************;" \

     --data-binary "{ 

    \"objects\" : [

        \"/g/some_url\",

        \"http://www.example.com/g/some_url/\"

    ],

    \"action\": \"invalidate\",

    \"type\": \"arl\",

    \"domain\": \"staging\"

}" \

'https://akab-******************.purge.akamaiapis.net/ccu/v2/queues/queueName'

=================

 

Obviously, my client_token, access_token, secret, and URL are omitted for this post, and the timestamp is no longer appropriate.

 

The above results in an error, like below.

=================

HTTP/1.1 400 Bad Request

Content-Length: 453

Date: Tue, 08 Sep 2015 20:05:23 GMT

Connection: close

Content-Type: application/problem+json

 

{

  "type": "https://problems.purge.akamaiapis.net/-/pep-authn/request-error",

  "title": "Bad request",

  "status": 400,

  "detail": "The authorization header does not have the right format",

  "instance": "https://akab-xxxxxxxxxxxxxxxxxxpurge.akamaiapis.net/ccu/v2/queues/queueName",

  "method": "POST",

  "serverIp": "23.222.121.131",

  "clientIp": "x.x.x.x",

  "requestId": "601bee3",

  "requestTime": "2015-09-08T20:05:23Z"

}

=================

 

Can someone please offer some suggestions and assistance?

 

Thanks!

Outcomes