AnsweredAssumed Answered

Change in accepted API payload?

Question asked by Gary Volland on Jun 4, 2019
Latest reply on Jun 4, 2019 by Gary Volland

I created a web app that would create folders, clone programs and populate those folders and programs with tokens with data from a campaign setup tool.

My tool is a Coldfusion web application.  Prior to last week, for example I called the clone api using:

<cfhttp url="#restUrl#/asset/v1/program/#arguments.id#/clone.json" method="post">
<cfhttpparam type="header" name="Authorization" value="Bearer #arguments.accessToken#" />
<cfhttpparam type="header" name="Content-Type" value="application/json; charset=utf-8">
<cfhttpparam type="url" name="folder" value="{ ""id"": #arguments.parentId#, ""type"":""Folder""}" />
<cfhttpparam type="url" name="name" value="#arguments.name#" />
<cfhttpparam type="url" name="description" value="#arguments.descript#" />
</cfhttp>

 

Since Monday, I receive an Connection Failure when I make the call.

 

The fix for the clone call was to use a cfhttpparam type = body.

 

<cfset var body = {} />
<cfset body["folder"] = {} />
<cfset body.folder["id"] = arguments.parentId />
<cfset body.folder["type"] = "Folder" />
<cfset body["name"] = arguments.name />
<cfset body["description"] = arguments.descript />

<cfhttp url="#restUrl#/asset/v1/program/#arguments.id#/clone.json" method="post">
<cfhttpparam type="header" name="Authorization" value="Bearer #arguments.accessToken#" />
<cfhttpparam type="header" name="Content-Type" value="application/json; charset=utf-8">
<cfhttpparam type="body" value="#serializeJSON(body)#" />
</cfhttp>

 

I encountered the same Connection Failure with the token api call.  However, the token api is not recognizing the body and I get a 701 error.  I have tried various body values, json and url encoded.  Since with the same errors.

 

I can use Postman to create a token.   With Postman, the attributes are form-data.

 

Thanks,

Gary

Outcomes