0

I am trying to get temp_token for credly API's badge builder SDK. I am using ColdFusion as server side language. My code look like,

    <cfhttp method=”post” result=”objGet” 
              url=”https://developers.credly.com/badge-builder/code” >
        <cfhttpparam type=”formfield” name=”access_token” value=”my_access_token” />
    </cfhttp>

As well as, I have tried

    <cfhttp method=”post” result=”objGet” 
              url=”https://developers.credly.com/badge-builder/code” >
        <cfhttpparam type="header" name="Authorization" value="access_token=(my_access_token)” />
    </cfhttp>


    <cfhttp method=”post” result=”objGet” 
              url=”https://developers.credly.com/badge-builder/code” >
        <cfhttpparam type="header" name="access_token" value="(my_access_token)” />
    </cfhttp>


    <cfhttp method=”post” result=”objGet” 
              url=”https://developers.credly.com/badge-builder/code” >
        <cfhttpparam type="header" name="access_token" value="my_access_token” />
    </cfhttp>

All of them are giving me response as,

{ 
  “success”:false,
  ”error”:”You must pass an access_token to retrieve a badge builder embed code”
}

Am I missing something?

Update: I have checked their official wordpress plugin, they are using type as body. I have tried that too, but gave the same result.

JS Mitrah
  • 686
  • 5
  • 12
  • 1
    Have you tried using "header" as cfhttpparam type? – Lucas Feb 13 '14 at 07:47
  • @Lucas I have already tried as well as then – JS Mitrah Feb 13 '14 at 09:06
  • [Edit the question](http://stackoverflow.com/posts/21746571/edit) to include that info. – Peter Boughton Feb 13 '14 at 09:50
  • i created an account of mine and while POST gave same response as your, the GET replied with "The Credly Badge Builder requires that Credly integration be activated for your site." is this taken care in your side? – Sanjeev Feb 14 '14 at 09:44
  • @Sanjeev while you create your app in credly, you have to enable all options, I am not sure which one is responsible for Badge builder. https://developers.credly.com/my-apps/new I have checked their official wordpress plugin, they are using cfhttpparam type as body. I have tried that too, but gave the same result. – JS Mitrah Feb 14 '14 at 13:31

0 Answers0