User Tools

Site Tools


fullapi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
fullapi [2020/08/01 23:02]
127.0.0.1 external edit
fullapi [2023/12/29 14:29] (current)
Line 1: Line 1:
 **## ACCESSO API AVANZATE - FULL API** **## ACCESSO API AVANZATE - FULL API**
  
-Prima di poter usare le API attivale in "il mio account > configurazione utente"+Prima di poter usare le API attivale clicca a destra  "sul nome utente > settings > enable webservice" e annota la token che verrà visualizzata in "webservice token"
  
 {{:schermata_2014-10-14_alle_22.24.00.png?600|}} {{:schermata_2014-10-14_alle_22.24.00.png?600|}}
  
 Webservices URL: Webservices URL:
-`https://www.smskdev.it/playsms/index.php?app=ws`+`https://www.smskdev.it/highway/index.php?app=ws`
  
-**[[http://www.smskdev.it/api/lib/exe/fetch.php/webservices_examples.zip|ZIP ARCHIVIO ESEMPI]]**+**[[https://www.smskdev.it/api/lib/exe/fetch.php?media=webservices_examples.zip|ZIP ARCHIVIO ESEMPI]]**
  
 ## Parametri ## Parametri
Line 38: Line 38:
 |kwd            | keyword| |kwd            | keyword|
  
-Listed in the below table are webservices parameters for admin tasks.+**Listed in the below table are webservices parameters for admin tasks.**
  
 |Name           | Description| |Name           | Description|
Line 235: Line 235:
 |Optional   | `format`| |Optional   | `format`|
 |Returns    | return codes and balance| |Returns    | return codes and balance|
 +
 +**## Protocol for admin tasks**
 +
 +
 +### Inject message
 +
 +Inject message to the system
 +
 +|Parameters | Name or description|
 +|---------- | --------------------|
 +|Operation  | `inject`|
 +|Mandatory  | `u` `h` `from` `msg` `recvnum` `smsc`|
 +|Optional   | `format`|
 +|Returns    | return codes|
 +
 +Injected message will be treated as a valid incoming SMS.
 +
 +### Stoplist Number
 +
 +Will add a number to the stoplist.
 +
 +|Parameters | Name or description|
 +|---------- | --------------------
 +|Operation  | `stoplist`|
 +|Mandatory  | `u` `h` `from`|
 +|Optional   | none|
 +|Returns    |  return codes (failure code is 627)|
 +
 +Number used in the 'from' field will be added to the stoplist feature to globally prevent outgoing messages sending to it.
 +example: `https://www.smskdev.it/highway/index.php?app=ws&u=<admin user>&h=<webkey>&op=stoplist&from=<number to be added>`
 +
 +### Add account
 +
 +Add an account
 +
 +|Parameters | Name or description|
 +|---------- | --------------------
 +|Operation  | `accountadd`|
 +|Mandatory  | `u` `h` `data_status` `data_username` `data_password` `data_name` `data_email`|
 +|Optional   | `format` `data_parent` `data_mobile` `data_datetime_timezone` `data_language_module`|
 +|Returns    | return codes and info|
 +
 +Notes:
 +* most mandatory and optional query parameters are prefixed with `data_`
 +* data_status 2 is for admin level account
 +* data_status 3 is for user level account
 +* data_status 4 is for subuser level account
 +* data_parent may need to be set when adding subuser level account
 +
 +
 +### Remove account
 +
 +Remove an account
 +
 +|Parameters | Name or description|
 +|---------- | --------------------
 +|Operation  | `accountremove`|
 +|Mandatory  | `u` `h` `data_username`|
 +|Optional   | `format`|
 +|Returns    | return codes and info|
 +
 +
 +### Set parent for subuser
 +
 +Set parent for subuser level account
 +
 +|Parameters | Name or description|
 +|---------- | --------------------
 +|Operation  | `parentset`|
 +|Mandatory  | `u` `h` `data_username` `data_parent`|
 +|Optional   | `format`|
 +|Returns    | return codes|
 +
 +
 +### Get parent from subuser
 +
 +Get parent from subuser level account
 +
 +|Parameters | Name or description|
 +|---------- | --------------------|
 +|Operation  | `parentget`|
 +|Mandatory  | `u` `h` `data_username`|
 +|Optional   | `format`|
 +|Returns    | return codes and data parent|
 +
 +
 +### Ban an account
 +
 +Ban an account
 +
 +|Parameters | Name or description|
 +|---------- | --------------------
 +|Operation  | `accountban`|
 +|Mandatory  | `u` `h` `data_username`|
 +|Optional   | `format`|
 +|Returns    | return codes|
 +
 +
 +### Unban an account
 +
 +Unban an account
 +
 +|Parameters | Name or description|
 +|---------- | --------------------
 +|Operation  | `accountunban`|
 +|Mandatory  | `u` `h` `data_username`|
 +|Optional   | `format`|
 +|Returns    | return codes|
 +
 +
 +### Update account preferences
 +
 +Update account preferences
 +
 +|Parameters | Name or description|
 +|---------- | --------------------
 +|Operation  | `accountpref`|
 +|Mandatory  | `u` `h` `data_username`|
 +|Optional   | `format` `data_name` `data_email` `data_mobile` `data_address` `data_city` `data_state`| |`data_country` `data_zipcode` `data_password`|
 +|Returns    | return codes and info|
 +
 +Notes:
 +* most mandatory and optional query parameters are prefixed with `data_`
 +* this command may be used to update account's password
 +
 +
 +### Update account configuration
 +
 +Update account configuration
 +
 +|Parameters | Name or description|
 +|---------- | --------------------
 +|Operation  | `accountconf`|
 +|Mandatory  | `u` `h` `data_username`|
 +|Optional   | `format` `data_footer` `datetime_timezone` `data_language_module` `data_fwd_to_inbox`| |`data_fwd_to_email` `data_fwd_to_mobile` `data_local_length` `data_replace_zero` `data_sender` |
 +|Returns    | return codes and info|
 +
 +Notes:
 +* most mandatory and optional query parameters are prefixed with `data_`
 +* this command may be used to update account's default sender ID
 +* only valid sender ID may be selected
 +* `data_fwd_to_inbox` `data_fwd_to_email` `data_fwd_to_mobile` are boolean variables, fill with 0 to disable and 1 to enable
 +* `data_local_length` used to detect local destination number by its length
 +* `data_replace_zero` is a numeric only prefix number to replace prefix 0
 +
 +
 +### View account credit
 +
 +View an account credit or balance
 +
 +|Parameters | Name or description|
 +|---------- | --------------------|
 +|Operation  | `creditview`|
 +|Mandatory  | `u` `h` `data_username`|
 +|Optional   | `format`|
 +|Returns    | return codes and balance|
 +
 +
 +### Add account credit
 +
 +Add credit to an account
 +
 +|Parameters | Name or description|
 +|---------- | --------------------|
 +|Operation  | `creditadd`|
 +|Mandatory  | `u` `h` `data_username` `data_amount`|
 +|Optional   | `format`|
 +|Returns    | return codes, updated balance and amount|
 +
 +
 +### Deduct account credit
 +
 +Deduct credit to an account
 +
 +|Parameters | Name or description|
 +|---------- | --------------------
 +|Operation  | `creditdeduct`|
 +|Mandatory  | `u` `h` `data_username` `data_amount`|
 +|Optional   | `format`|
 +|Returns    | return codes, updated balance and amount|
 +
 +
 +### Set login key
 +
 +Set login key for an account
 +
 +|Parameters | Name or description|
 +|---------- | --------------------|
 +|Operation  | `loginkeyset`|
 +|Mandatory  | `u` `h` `data_username`|
 +|Optional   | `format`|
 +|Returns    | return codes and login key|
 +
 +
 +## Examples
 +
 +
 +### Send SMS
 +
 +Example webservice URL:
 +
 +```
 +https://www.smskdev.it/highway/index.php?app=ws&u=example&h=a45a027000002fedb078c39fd83637a&op=pv&to=0987654321&msg=test+only
 +```
 +
 +Explanation:
 +
 +highway webservices in x.dom with 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 succeeded highway will returns OK status message in JSON format:
 +
 +```
 +{"data":[{"status":"OK","error":"0","smslog_id":"30","queue":"afb5f34575e30ec4efe4471cf5d1bee4","to":"0987654321"}],"error_string":null}
 +```
 +When error occurred highway will returns one of the return code, also in JSON format.
 +
 +##### Scheduled SMS:
 +
 +Send SMS at 15:30:00 2019-04-29
 +
 +```
 +https://www.smskdev.it/highway/index.php?app=ws&u=example&h=a45a02791b2fe2fedb078c39fd83637a&op=pv&to=0987654321&msg=test+only&schedule=2019-04-29%2015:30:00
 +```
 +Both `+` and `%20` can be used between date and time, but `%20` is recommended.
 +
 +
 +### List of incoming SMS
 +
 +Example webservice URL:
 +
 +```
 +https://www.smskdev.it/highway/index.php?app=ws&u=example&h=482ac000000c647289e52dfef88be60&op=in&kwd=HCNX&format=xml
 +```
 +
 +Explanation:
 +
 +highway webservices in x.com with operation `op` in (incoming SMS) was accessed by a user using username `u` and webservices token `h` with keyword `kwd` IDOL and expected output format is in XML format `format=xml`.
 +
 +When succeeded highway will returns OK status message in XML format:
 +
 +```
 +<response>
 +    <data>
 +        <item>
 +            <id>2</id>
 +            <src>+393000000111</src>
 +            <dst>1234</dst>
 +            <kwd>HCNX</kwd>
 +            <msg>A</msg>
 +            <dt>2013-05-20 12:40:38</dt>
 +            <status>1</status>
 +        </item>
 +    </data>
 +</response>
 +```
 +
 +When error occurred highway will returns one of the return code, also in XML format.
 +
 +
 +### List of contacts on phonebook
 +
 +Example webservice URL:
 +
 +```
 +https://www.smskdev.it/highway/index.php?app=ws&u=example&h=482ac000000c647289e52dfef88be60&op=get_contact&kwd=example
 +```
 +
 +Explanation:
 +
 +highway webservices in x.com with operation `op` get_contact was accessed by a user using username `u` and webservices token `h` with keyword `kwd` example and expected output format is in JSON format.
 +
 +When succeeded highway will returns OK status message in JSON format:
 +
 +```
 +{"status":"OK","error":"0","data":[{"pid":"13674","gpid":"2","p_desc":"Lorem ipsum","p_num":"390000111","email":"","group_name":"Test Group","code":"TESTGROUP"}],"multi":true}
 +```
 +
 +When error occurred highway will returns one of the return code, also in JS
  
fullapi.1596322936.txt.gz · Last modified: 2023/12/29 14:29 (external edit)