Using Docker installation method
No. I'm currently also on the latest release.
Host Operating System
Ubuntu 18.04.2 LTS, 64-bit
Describe the bug
I am unable to create a streamer/DJ account via the API. I'm getting the following error while:
Method not allowed
Method not allowed. Must be one of: GET
I'm using POST /station/2/streamers with the following post data:
{
"id": 100,
"streamer_username": "dj_test",
"streamer_password": "test",
"display_name": "Test DJ",
"comments": "This is a test DJ account.",
"is_active": true,
"reactivate_at": 1557110169
}
According to the API docs, it should work.
To Reproduce
Try to do POST /station/{station_id}/streamers with data
{
"id": 100,
"streamer_username": "dj_test",
"streamer_password": "test",
"display_name": "Test DJ",
"comments": "This is a test DJ account.",
"is_active": true,
"reactivate_at": 1557110169
}
It should be happening. I'm using https://apitester.com/ in order to test it.
Expected behavior
It should accept a POST, like mentioned in the API docs.
Relevant Logs
N/A
Screenshots
https://share.pilovali.nl/Screenshot_2019-05-05%20API%20Tester.png
Device(s):
Additional context
@pilovali I'm not able to reproduce this error using Postman locally...the POST /api/station/1/streamers with a JSON body properly processes and adds the streaming account to the station.
It's possible that your route cache is out of date for whatever reason...the file would be located at /var/azuracast/www_tmp/routes.php, and you can just remove that file and it will regenerate itself.
@pilovali I have encountered that message a few times in the past due to small mistakes in the API URL. As I can't directly see this on your screenshot, can you make sure that you are calling /api/station/1/streamers and not only /station/1/streamers?
@pilovali I have encountered that message a few times in the past due to small mistakes in the API URL. As I can't directly see this on your screenshot, can you make sure that you are calling
/api/station/1/streamersand not only/station/1/streamers?
I'm stupid. This works. Thanks!
However, now I'm getting this error:
Object(App\Entity\StationStreamer).streamer_username:
This value should not be blank. (code c1051bb4-d103-4f74-8988-acbcafc7fdc3)
It isn't blank:
"streamer_username": "testingacct",
@pilovali Make sure you're also sending a header of Content-Type: application/json so it knows you're sending it a JSON body instead of regular form parameters.
@pilovali Make sure you're also sending a header of
Content-Type: application/jsonso it knows you're sending it a JSON body instead of regular form parameters.
Love you. I'm new at this, sorry.
It's working great now.