REST API from Omnis... Short example...

Sten-Erik Björling s-e.bjorling at enviro.se
Sun Aug 29 16:19:52 UTC 2021


Hi,

Below a short example of an API method:

Do $cinst.$addhttpresponseheader('content-type','text/plain')

Calculate lnActorID as randintrng(1,200)
Do lpoSalesAnalysis.$ActorSalesByCategory(lnActorID,llActorSalesResults) ; The call here delivers the result from the database into the local list llActorSalesResults

Do OJSON.$listorrowtojson(llActorSalesResults,kUniTypeUTF8,lchErrorText,kOJSONoptionNone) Returns lbinResultBinary

Do $cinst.$sethttpstatus(200,'OK')

Quit method lbinResultBinary

Hope this helps…

Stene

_______


Sten-Erik Björling
Enviro Data
Kyrkogatan 5A 2 tr
SE-972 32  Luleå
Sweden

E-Mail: s-e.bjorling at enviro.se
Mobile: +46-70-655 11 72
Wire: @stenerikbjorling
Skype: stenerikbjorling
iChat: stene at icloud.com
FaceTime: stene at icloud.com
whereby.com: stenerikbjorling
Hotmail / Messenger: stenerikbjorling at hotmail.com
GMail: stenerikbjorling at gmail.com
______

This email and any files transmitted with it are confidential, may be legally privileged and are intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, please note that any use, distribution, or reproduction of the contents of this email is strictly prohibited and may be unlawful. If you are not the intended recipient, please notify the sender by return email and destroy all copies of the original message including any attachments thereto. Thank you.

Please note that we take reasonable precautions to prevent the transmission of viruses; however, we cannot guarantee that this email or its attachments are free from viruses. We only send and receive emails on the basis that we are not be liable for any loss or damage resulting from the opening of this message and/or attachments.



More information about the omnisdev-en mailing list