Skip to content

Instantly share code, notes, and snippets.

@andrastudio
Last active November 8, 2019 11:53
Show Gist options
  • Save andrastudio/228201b6a66dd8405ea343a6a89598da to your computer and use it in GitHub Desktop.
Save andrastudio/228201b6a66dd8405ea343a6a89598da to your computer and use it in GitHub Desktop.
wassenger API via curl
$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