O7: using cURL

Phil (OmnisList) phil at pgpotter.co.uk
Tue Jan 5 09:19:22 UTC 2021


Could you send the output to a file,
ie ' >file.txt'
and then parse the file to retrieve the information?


regards
Phil Potter
Based in Chester in the UK.

On 05/01/2021 09:01, Daniel Sananes wrote:
> Hi
> We have new projects that involves making API-calls.
> I have familiarized myself with cURL to perform these calls.
> But how would I use cURL inside Omnis7?
> With the command Start program I can start the command prompt but how do I read the answer from the cURL-program?
>
> I can open the command prompt and issue this command:
> C:\Users\daniel.s>curl -H "Authorization: Basic Wkw5V0ExV1gxMzRBMzE4UktHOUowWFJXS0xaQVJTWUQ6TVNOSkpTRDVQTTlTRkMxQ1ZMREMyNllHVFVMVDRSWkU=" -X POST https://login.smartpooling.se/uaa/oauth/token -d grant_type=password -d username=Username -d password=Password
>
> Which gives me this in return:
> {"access_token":"51b6c672-3fd6-4bac-be9d-8ba19bfc03a6","token_type":"bearer","refresh_token":"fa6cd5f7-166b-479e-84a5-c38b0cd7c2ce","expires_in":31371,"scope":"read write"}
>
> How would I issue the command from inside Omnis7 and how would I receive the returned text into Omis7?
> Is this even possible?
>
> Regards
> Daniel Sananes


More information about the omnisdev-en mailing list