Last active
November 8, 2019 11:53
-
-
Save andrastudio/228201b6a66dd8405ea343a6a89598da to your computer and use it in GitHub Desktop.
wassenger API via curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = array("phone" => "+6281290004782", "message" => "Hai pak, apa kabar?"); | |
$data_string = json_encode($data); | |
$ch = curl_init('https://api.wassenger.com/v1/messages'); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array( | |
'Content-Type: application/json', | |
'Token: your-api-token', | |
)); | |
$result = curl_exec($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment