How can I use CURL to consume an API?

Hi everyone,

I’m new to consuming APIs from a Clarion application and I’m trying to make a POST request like the following:

curl -X POST “https://api.valida-cfdi.com.mx/v1/zapier/actions/validate-cfdi
-H “X-API-Key: vck_tu_api_key”
-H “Content-Type: application/json”
-d ‘{
“uuid”: “12345678-1234-1234-1234-123456789012”,
“rfc_emisor”: “ABC123456XYZ”,
“rfc_receptor”: “DEF789012UVW”,
“total”: 1500.00
}’
What would be the best way to implement this in Clarion?

Does anyone have an example of making a POST request with custom headers and a JSON payload from a Clarion application?

Any advice, sample code, or recommended libraries would be greatly appreciated.

Thanks in advance!

Regards,

Go here…

…download the apps and see how to do it. There are several examples, including using APIs.

Ask more questions and provide more details, if necessary.

LibCurl is a good option.

jFiles will help with creating JSON payloads.
https://capesoft.com/accessories/jFilessp.htm

NetTalk Desktop is an alternative to LibCurl.
Using this allows you to use CurlCode which translates Curl statements into NetTalk for you.

https://capesoft.com/curlcode

https://capesoft.com/accessories/netsp.htm