hbcurl and post parameter --data-urlencode

214 views
Skip to first unread message

Reinaldo

unread,
Jun 19, 2021, 12:13:28 PM6/19/21
to Harbour Users
Hello everyone;

I need to send cUrl POST "--data-urlencode" parameter to https and i'm using hbcurl lib.   I have all others figured out and working.  My only doubt is with --data-urlencode   

Here is the curl command I need to emulate.  Please notice the --data-urlencode parameters which I have highlighted for easier reading and is the only part that's not working for me using hbcurl lib:

curl -X POST https://api.helloworks.com/v3/workflow_instances \ -H "Authorization: Bearer $JWT" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "workflow_id=abcdefg" \ --data-urlencode "white_label_id=zyxwvut" \ --data-urlencode "language=fr-CA" \ --data-urlencode "notify_when_complete=true" \ --data-urlencode "notify=1029384756" \ --data-urlencode "document_delivery=true" \ --data-urlencode "document_delivery_type=link" \ --data-urlencode "delegated_authentication=true" \ --data-urlencode "participants[signer][type]=email" \ --data-urlencode "participants[signer][value]=te...@example.com" \ --data-urlencode "participants[signer][full_name]=John Doe" \ --data-urlencode "callback_url=https://www.example.com/callback" \ --data-urlencode "redirect_url=https://www.example.com/success_page" \ --data-urlencode "merge_fields[requester_address]=123 Main St. San Francisco, CA 94101" \ --data-urlencode "merge_fields[effective_date]=January 1st, 2018" \ --data-urlencode "metadata[tracking_id]=4803294032" \ --data-urlencode "metadata[account_id]=1234"

Any ideas?

Reinaldo

unread,
Jun 19, 2021, 12:49:17 PM6/19/21
to Harbour Users
Another way would be to send Json with cURL.   That's done using -d in cURL.  Is -d parameter implemented on hbcurl.lib and if so, how?

 -H"Authorization: Bearer $JWT" \
 -H"Content-Type: application/json" \
 -d"{ "workflow_id" : "abcdefg",  "language" : "fr-CA",  "white_label_id": "zyxwvut", "participants": { "signer": { "type": "email", "value": "te...@domain.com", "full_name": "John Doe" } }, "notify_when_complete": true, "notify": "1029384756", "document_delivery": true, "document_delivery_type": "link", "callback_url": "https://www.mysite.com/a/b/c", "redirect_url": "https://www.mysite.com/a/b/c", "merge_fields": { "requester_address": "123 Main St. San Francisco, CA 94101" "effective_date": "January 1st, 2018" }, "metadata": { "tracking_id": "4803294032", "account_id": "1234" } }"

Thank you.
Message has been deleted

Vikram Chhajer

unread,
Jun 20, 2021, 3:43:57 AM6/20/21
to Harbour Users
Hello Renialdo 

please suggest me how to implement this  Msxml2.ServerXMLHTTP.6.0
     -H "Authorization: Bearer <ACCESS_TOKEN>" \
     -H "Content-Type: multipart/form-data" \
     -F attributes="{"name":"Contract.pdf", "parent":{"id":"11446498"}}" \
     -F file=@<FILE_NAME>


vikram 
Reply all
Reply to author
Forward
0 new messages