RESTful PUT error

andrew at andrew at
Sun Nov 26 10:37:40 EST 2017

I'm working on connecting to a 3rd-party API (Pipedrive) to a LiveCode  
app I've done and seem to have a problem; any assistance would be  
appreciated. Dummy (sandbox) account information has been included  
with my code sample.

I've never used RESTful before, but the API seems pretty well  
documented and I've had success much faster than anticipated working  
with the data in LiveCode. It looks like commands are broke down into  
3 types: GET (to retrieve data), POST (to create new data), and PUT  
(to update existing data).

I can retrieve data using "put URL tRequestURL1 into tJSONfromPipedrive"
I can create new data using "post tJSONtoUpload to url tRequestURL2"
But when I try to update data using "put tJSONtoUpload into url  
tRequestURL2" I get a 400 error from the server. I tried to  
urlEncode(tJSONtoUpload) but got the same error.

Their API includes a sandbox for testing, and my code seems to align  
with their examples and helped me get my tests in order. I'm just not  
sure what's wrong with my PUT command.!/Persons/put_persons_id

httpHeaders = {"Accept":"application/json"}
tRequestURL1 =
tRequestURL2 =
tJSONtoUpload = {"phone":"555-555-5555"}

Is there something glaring I'm missing? I can get this to execute on  
their developer website, but using the same code seems to error out  
for me in LiveCode 8.2.0dp2 Business.

--Andrew Bell

More information about the use-livecode mailing list