Here are some CURL examples, which will help you understand the REST API:
- Request Verification Flashcall (Preferred flow without CLI return): (we can configure your account for returning the CLI to expect in the request http response, useful for matching OTP code without dependency on report step.)
curl--user APPLICATION_KEY:APPLICATION_SECRET https://verificationapi-v1.sinch.com/verification/v1/verifications -H "Content-Type: application/json" --data "{'identity':{'type':'number','endpoint':'+1555123123'},'method':'flashcall'}"
Sinch can configure the API to return the CLI on request (OTP Code).
- Report Verification Flashcall using Verification ID (no PI-data i URL):
curl -X PUT --user APPLICATION_KEY:APPLICATION_SECRET https://verificationapi-v1.sinch.com/verification/v1/verifications/id/d41281c6d5094a688371449e33a0a7... -H "Content-Type: application/json" --data "{'method': 'flashcall', 'flashcall': {'cli': 'OTPCODE'}}"
- Request Verification SMS (Default, documented flow):
curl --user APPLICATION_KEY:APPLICATION_SECRET https://verificationapi-v1.sinch.com/verification/v1/verifications -H "Content-Type: application/json" --data "{'identity':{'type':'number','endpoint':'+1555123123'},'method':'sms'}"
- Request Verification SMS with custom code (NON DOCUMENTED):
curl --user APPLICATION_KEY:APPLICATION_SECRET https://verificationapi-v1.sinch.com/verification/v1/verifications -H "Content-Type: application/json" --data "{'identity':{'type':'number','endpoint':'+1555123123'},'method':'sms','smsOptions':{'code':'123456'}}"
Note: When the customer specifies their code, the report verification step is strictly not necessary but still desirable.
- Report Verification SMS OTP:
curl -X PUT --user APPLICATION_KEY:APPLICATION_SECRET https://verificationapi-v1.sinch.com/verification/v1/verifications/number/+1555123123 -H "Content-Type: application/json" --data "{'method': 'sms', 'sms': {'code': 'OTPCODE'}}"
Note: When using the REST API, Callbacks are not needed. Callbacks may be useful for tracking costs, but only if this is a direct customer request.
View the Sinch Verification Developer Documentation for more information.
Learn how you can use the Sinch Verification APIs to secure your business and enhance relationships with your customers.