3

I was integrating a REST API of iCIMS and found some of the REST API calls need the http verb PATCH. However, it seems ColdFusion 10 doesn't support that. Is there any way around this?

Leigh
  • 28,765
  • 10
  • 55
  • 103
Roul
  • 945
  • 1
  • 12
  • 34

2 Answers2

7

Working with iCIMS API also here, but on CF 9, so no support for PATCH. But I did find that you can do a POST and then override that with an additional header: X-HTTP-Method-Override: PATCH

On iCIMS API, the PATCH method is required to update some data vs. a POST which creates a new entry. So something like the following should work.

<cfhttp method="post" url="api.icims.com/customers/1234/people/1289/fields/phones/332">
<cfhttpparam type="header" name="Authorization" value="Basic #auth_string#" >
<cfhttpparam type="header" name="X-HTTP-Method-Override" value="PATCH">
<cfhttpparam type="body" value="#your_json#" >
</cfhttp>
Matt W
  • 71
  • 1
  • 2
1

This was not added until ColdFusion 11 update 3.

Most API services allow you to use POST instead of PATCH. From the docs for iCIMS it appears they accept either POST or PATCH as well.

Sean Coyne
  • 3,864
  • 21
  • 24