In order to gain authentication to act on behalf of a KeySMS user, each request must be signed.
Every user can generate an API key in the App itself, and this secret key is in time inputted into your application along with the username.
Request signing happens by signing the JSON data string, and a signed request requires three parameters : signature,username and payload.
Payload refers to the entire payload you would normally send in the HTTP POST request. The post data must be JSON encoded.
The following straight forward PHP code describes the required post data:
$payload = json_encode($payloadArray);
$postFields = array(
'signature' => md5($payload . $secretKey),
'username' => $username,
'payload' => $payload
);
Supports the following arguments:
messagerequired UTF-8 encoded messagereceiversrequired Array of receiverssenderrequired Which of the accounts receivers to send fromtimeA timestamp in the future to send at. Defaults to nowdateA date in the future to send at. Defaults to today
curl -XPOST https://app.keysms.no/messages -d payload='{"message":"Hello world", "receivers":["99999999"]}' -d signature="your generated sign key" -d username="me"
The following errors may be returned
Supports the following arguments:
userbool Return information about logged in useraccountbool Return information about account for logged in usercontactsbool Return the full contact listgroupsbool Return groupsaliasesbool Return aliaseskeywordsbool Return keywords
curl -XPOST https://app.keysms.no/messages -d user=1 -d account=0 -d groups=1 -d signature="foo" -d username="bar"