Now the main functions and your API keys are saved, let's run a quick test to make sure their is a connection to the SquidVault API.
This API call sends a plain text message to SquidVault which is simply echoed back to show that the connection is valid.
{ "action":"connectionTest", "message":"Hello World" }
Success:
{ "error":"", "status":"success", "data": "-- Base64 encoded AES-256-CBC encrypted JSON --", "action":"connectionTest", "version":"1.07", "proc_time":1651245937, "proc_id":1 } "data" (decrypted) { "message":"Got message : Hello World" }
Failure:
{ "error":"unauthorised", "status":"failure" }
apiKey missing: The API key is missing from the request.
apiKey invalid: The API key is invalid. Please make sure you have added your API key and secret correctly.
unauthorised: The encryption is invalid. Please make sure you have added your API key and secret correctly.
<?php
print_r(
request(
[
'action'=>'connectionTest',
'message'=>'Hello World'
]
)
);
/*############### OUTPUT ##################
Array(
[error] =>
[status] => success
[data] => {"message":"Got message : Hello World"}
[action] => connectionTest
[version] => 1.07
[proc_time] => 1651246940
[proc_id] => 10
)
#########################################*/
?>
Copy Code