This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
pvs:integrate_customdevkit [2016/03/03 15:57] rsk created |
pvs:integrate_customdevkit [2020/03/22 09:15] (current) rsk [Example] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Integrating an API with the Custom Dev Kit ====== | ====== Integrating an API with the Custom Dev Kit ====== | ||
+ | This page explains the necessary steps to integrate any 3rd party SMS API gateway into MyRSK' | ||
+ | ===== Requirements ===== | ||
+ | |||
+ | * API access credentials for the 3rd party SMS/API gateway | ||
+ | * Knowledge of PHP | ||
+ | |||
+ | ===== Please Remember ===== | ||
+ | |||
+ | * < | ||
+ | * < | ||
+ | |||
+ | ===== The Steps ===== | ||
+ | |||
+ | * open customdevkit.php file (which can be found in the Layer' | ||
+ | * provide the API credentials in the script, this depends on the Gateway provider. Some call them username/ | ||
+ | * provide the content of the SMS message in the < | ||
+ | * build & execute the api request (have a look at example files from your gateway provider) | ||
+ | * log the API Request attempt to help troubleshoot | ||
+ | ===== Example ===== | ||
+ | |||
+ | The example shows how to integrate Clickatell' | ||
+ | |||
+ | <file php customdevkit.php> | ||
+ | <?php | ||
+ | # Layer' | ||
+ | # | ||
+ | # This file contains an example to help you integrate any SMS provider API's gateway. | ||
+ | # The example below shows how to integrate Clickatell' | ||
+ | # Please be advised that we do not provide support for custom integrations. | ||
+ | # | ||
+ | # $phone will be automatically supplied, and contains the customer' | ||
+ | # $code will be automatically supplied, and contains a 4 digit code | ||
+ | # | ||
+ | # Example is provided below | ||
+ | |||
+ | |||
+ | #provide api credentials | ||
+ | $apiid=" | ||
+ | $apiuser=" | ||
+ | $apipassword=" | ||
+ | |||
+ | #provide the content of the SMS message - remember to include the $code variable in your message, as that is the code to be sent to the customer | ||
+ | $body=" | ||
+ | |||
+ | #build the API request | ||
+ | $url = ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ]); | ||
+ | |||
+ | $ch = curl_init($url); | ||
+ | curl_setopt($ch, | ||
+ | $clickatell = curl_exec($ch); | ||
+ | |||
+ | |||
+ | #log the attempt to help troubleshoot | ||
+ | logModuleCall(" | ||
+ | |||
+ | ?> | ||
+ | </ |