-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can you run a POST or PUT with this api #14
Comments
You create a PHP script that uses the composer autoload file to get access to the library, then instantiate a client with the URL/IP and API key for your AzuraCast instance and then just call the method you want to use with the parameters that are specified for it in the corresponding format. <?php
require __DIR__ . '/vendor/autoload.php';
$api = \AzuraCast\Api\Client::create(
'my.azuracast.host.com',
'xxxx:xxxx'
);
$api->station(1)->streamers()->create(
'vaalyn',
'mypassword',
'Vaalyn',
'This is my personal account',
true
); This will send a POST request to the specified AzuraCast instance to create a streamer account. All you have to do is execute the PHP script then. This can be as simple as running it directly on the command line with via |
[04-Aug-2019 03:09:54 UTC] PHP Fatal error: Uncaught AzuraCast\Api\Exception\AccessDeniedException: {"code":403,"message":"Permission Denied","formatted_message":"Permission Denied","extra_data":[],"success":false} in /home/itspower/vendor/azuracast/php-api-client/src/AbstractClient.php:58 |
I updated both my azuracast, and composer package, and now these errors show for both creating Streamers, and showing nowPlaying data: |
The first error you posted ( About the <?php
require __DIR__ . '/vendor/autoload.php';
$api = \AzuraCast\Api\Client::create(
'localhost',
'fad674101a36198c:397fc35b10da7f0ace26f8080dede0b3'
);
$newStreamer = $api->station(1)->streamers()->create(
'vaalyn',
'mypassword',
'Vaalyn',
'This is my personal account',
true
);
var_dump($newStreamer);
var_dump($api->station(1)->nowPlaying()); Could you copy and paste your code here so that I can take a look at it? |
I fixed it by generating a new API key |
For example,
$api->station($stationId)->streamers()->create(
string $username,
string $password,
string $displayName,
string $comments,
bool $isActive
);
how would you actually execute this?
The text was updated successfully, but these errors were encountered: