Skip to content

Instantly share code, notes, and snippets.

@lav45
Created April 10, 2017 07:52
Show Gist options
  • Save lav45/3a86e49127cf7db46dc9f87e4192bfbf to your computer and use it in GitHub Desktop.
Save lav45/3a86e49127cf7db46dc9f87e4192bfbf to your computer and use it in GitHub Desktop.
Test flespi.io gateway
<?php
$url = 'https://flespi.io/gw/channels/{channels}/messages';
$channels = implode(',', [136]);
$url = str_replace('{channels}', $channels, $url);
// $data = ['timeout' => 10];
// $data = json_encode($data);
// $url .= '?' . http_build_query(['data' => $data]);
$context = stream_context_create([
'http' => [
'method' => 'GET',
'header' => 'Authorization: FlespiToken DSQUoIjSF9aUySVA9rMaP6NQ58rLUYYlGE5TaczGbyqxgbWdryb4tMLoI0XsOMDj'
]
]);
$result = file_get_contents($url, null, $context);
$result = json_decode($result, true);
print_r($result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment