Difference between revisions of "NoAuth usecase 3"

From i2Rest
Jump to: navigation, search
Line 7: Line 7:
 
When the preparations are completed, all we have to do - is just perform POST request with application/json body type.
 
When the preparations are completed, all we have to do - is just perform POST request with application/json body type.
 
    
 
    
 
+
<pre>
 
+
I2REST COMMAND(*POST)  
 
+
      URL('https://rest.nexmo.com/sms/json')
 
+
      BODY(*N '{"api_key":"40a45a89", "api_secret":"EN8AHxD6fOd1jvWD", "from":"Vonage SMS API", "to":"375297784290", "text":"Hello from i2Rest"}' 'application/json')  
  I2REST COMMAND(*POST) URL('https://rest.nexmo.com/sms/json')
+
      OUTPUT(*BOTH)
  BODY(*N '{"api_key":"40a45a89", "api_secret":"EN8AHxD6fOd1jvWD", "from":"Vonage SMS API",
+
      DCMCLIENT(MYCLIENT)  
  "to":"375297784290", "text":"Hello from i2Rest"}' 'application/json') OUTPUT(*BOTH)
+
      RECVLOG('/home/btpl/recvnex.log')  
  DCMCLIENT(MYCLIENT) RECVLOG('/home/btpl/recvnex.log') SENTLOG('/home/btpl/sentnex.log') AUTHMETHOD(*NONE)     
+
      SENTLOG('/home/btpl/sentnex.log')  
 
+
      AUTHMETHOD(*NONE)     
 +
</pre>
 
Was it your phone ring? Check it.<br>
 
Was it your phone ring? Check it.<br>
 
[[File:Noauth3-2.png]]  
 
[[File:Noauth3-2.png]]  

Revision as of 13:36, 12 April 2020


Two things we have to take care before we start messaging:

free registration on Nexmo.com
adding SSL certificate

When the preparations are completed, all we have to do - is just perform POST request with application/json body type.

I2REST COMMAND(*POST) 
       URL('https://rest.nexmo.com/sms/json')
       BODY(*N '{"api_key":"40a45a89", "api_secret":"EN8AHxD6fOd1jvWD", "from":"Vonage SMS API",  "to":"375297784290", "text":"Hello from i2Rest"}' 'application/json') 
       OUTPUT(*BOTH)
       DCMCLIENT(MYCLIENT) 
       RECVLOG('/home/btpl/recvnex.log') 
       SENTLOG('/home/btpl/sentnex.log') 
       AUTHMETHOD(*NONE)    

Was it your phone ring? Check it.
Noauth3-2.png



Back to i2Rest Client