Skip to main content

Examples

Send SMS

Example webservice URL:

http://infopi.io/text/index.php?app=ws&u=<username>&h=<token>&op=pv&to=0987654321&msg=test+only

Explanation

operation op pv (send SMS) was accessed by a user using username u and webservices token h with destination number to 0987654321, message msg 'test only' and expected output format is the default format, JSON format.

When successful InfoPi will returns OK status message in JSON format:

{"data":[{"status":"OK","error":"0","smslog_id":"30","queue":"afb5f34575e30ec4efe4471cf5d1bee4","to":"0987654321"}],"error_string":null}

If error occurred Infopi returns one of the return code, also in JSON format.

List of incoming SMS

Example webservice URL:

http://infopi.io/text/index.php?app=ws&u=<username>&h=<token>&op=in&kwd=school&format=xml

Explanation:

InfoPi webservices in infopi.io with operation op in (incoming SMS) was accessed by a user using username u and webservices token h with keyword kwd school and expected output format is in XML format format=xml.

When successful InfoPi will return OK status message in XML format:

<response>   

                     <data>       

                                  <item>           

                                              <id>2</id>           

                                              <src>+254987654321</src>           

                                              <dst>1234</dst>           

                                              <kwd>school</kwd>           

                                              <msg>A</msg>           

                                              <dt>2013-05-20 12:40:38</dt>           

                                              <status>1</status>       

                                </item>   

                   </data>

</response>

If error occurrs InfoPi will return one of the error codes, also in XML format.

List of Contacts on Phonebook

Example webservice URL:

http://infopi.io/text/index.php?app=ws&u=<username>&h=<token>&op=get_contact&kwd=james

Explanation:

Infopi webservices in infopi.io with operation op get_contact was accessed by a user using username u and webservices token h with keyword kwd james and expected output format is in JSON format.

When successful InfoPi will return OK status message in JSON format:

{"status":"OK","error":"0","data":[{"pid":"1234","gpid":"2","p_desc":"James Doe","p_num":"08901230659","email":"","group_name":"Test Group","code":"TESTGROUP"}],"multi":true}

If error occurred InfoPi will returns one of the return code, also in JSON format.