Subject Re: Interface To Suare
From Gaetano <gaetanodd@hotmail.com>
Date Fri, 11 Dec 2020 07:41:35 +1000
Newsgroups dbase.getting-started


Since curl is a command line tool, you could try to put this in a batch
file and run the batch file with dBase:

run myCurlRequest.bat
or
!myCurlRequest.bat

"Run" does not halt program execution, so you may need to put a waiting
loop after that line to allow the command to execute and return whatever
it needs to return, especially if you need to do something in dBase with
that output.

I have recently use curl to grab url responses and you can redirect the
output to a file as follows: [curl commands] > output.txt

Cheers,
Gaetano.

On 10/12/2020 19:14, Michael wrote:
> Hi Guys,
>
> I havent done much work in this area but I have seen some code floating around which looks simple enough.
>
> However, I always seem to have trouble with the Tokens, Can someone help with some code to Post this Curl code from Dbase,
>
> curl https://connect.squareupsandbox.com/v2/devices/codes \
>    -X POST \
>    -H 'Square-Version: 2020-11-18' \
>    -H 'Authorization: Bearer EAAAEOJ-BwWS_3lC-r06cFzv0veA9Vc0MmRV08Ei0jFKFS9Mi8UB87zm1n1pvBsa' \
>    -H 'Content-Type: application/json' \
>    -d '{
>      "idempotency_key": "cc2404c4-48b5-4864-a81a-9b4418869565",
>      "device_code": {
>        "product_type": "TERMINAL_API"
>      }
>    }'
>
> Thank you,
>
> Michael
>