Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

Cfhttp Curl

$
0
0

Hello,

 

Box.com has an API that allows files/folders to be manipulated programmatically.  The syntax using the curl command to generate a link to a file uploaded to box.com is:

 

curl https://api.box.com/2.0/folders/FOLDER_ID -H "Authorization: Bearer ACCESS_TOKEN" --data '{"shared_link": {"access": "open"}}' -X PUT

 

I'm unable to figure out the correct syntax for sending the --data part of the curl command.  So far, I have this:

 

    <cfhttp method="PUT" url="#web_svc#"  redirect="yes" timeout="30">

        <cfhttpparam type="header" name="Authorization" value="Bearer #access_token#"/>

        <cfhttpparam type="formField" name="shared_link" encoded="no" value="{"access": "open"}"/>

    </cfhttp>

 

But Box throws an error:

 

Invalid value '0={"shared_link": {"access": "open"}}'. Entity body should be a correctly nested resource attribute name/value pair

 

Any suggestions would be greatly appreciated.


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>