Just wanted to update incase anyone searches or follows the thread.
As of today 8th June, I want to confirm that it appears CLI Mock-API does not fully support the updated API’s included in the current Documentation. I have asked similar questions on the Twitch CLI GitHub if these are planned and will update my thread if they provide new information.
API’s in reference to:
https://staging-discuss.dev.twitch.com/t/announcing-apis-and-eventsub-for-polls-and-predictions/31539
Trying to create a Prediction with greater than 2 Outcomes on the CLI Mock-API results in an Error 400 bad request while doing the same with exactly 2 works. Other new features have resulted in similar issues.
(Client/Secret and Auth have been replaced by Mock Data).
Query with More than 2 Prediction Options
curl -X POST 'http://localhost:8080/mock/predictions' \
-H 'Authorization: Bearer 5a867e772ef86eb' \
-H 'Client-Id: 5b75b31c3445cc9f38c1730f10db60' \
-H 'Content-Type: application/json' \
-d '{
"broadcaster_id": "36006691",
"title": "New Prediction Title",
"outcomes":
[{
"title": "Outcome Option0"
}, {
"title": "Outcome Option1"
}, {
"title": "Outcome Option2"
}, {
"title": "Outcome Option3"
}],
"prediction_window": 120
}'
Response (Failure)
{
"status": 400,
"error": "Bad Request",
"message": "outcomes must be exactly 2 items"
}
While a Query with Exactly 2 Works
curl -X POST 'http://localhost:8080/mock/predictions' \
-H 'Authorization: Bearer 5a867e772ef86eb' \
-H 'Client-Id: 5b75b31c3445cc9f38c1730f10db60' \
-H 'Content-Type: application/json' \
-d '{
"broadcaster_id": "36006691",
"title": "New Prediction Title",
"outcomes":
[{
"title": "Outcome Option0"
}, {
"title": "Outcome Option1"
}],
"prediction_window": 120
}'
Response (Success)
{
"data": [{
"id": "7114699f-7159-922d-8239-096923c5fac2",
"broadcaster_id": "36006691",
"broadcaster_login": "lionjack475",
"broadcaster_name": "LionJack475",
"title": "New Prediction Title",
"winning_outcome_id": null,
"prediction_window": 120,
"status": "ACTIVE",
"started_at": "2022-06-08T20:05:22Z",
"ended_at": null,
"locked_at": null,
"outcomes": [{
"id": "96456bed-0e0f-2a3e-8c68-b4b6148e268e",
"title": "Outcome Option0",
"users": 0,
"channel_points": 0,
"top_predictors": null,
"color": "BLUE"
}, {
"id": "62e0365f-d3e2-3c6e-fca2-78905272920b",
"title": "Outcome Option1",
"users": 0,
"channel_points": 0,
"top_predictors": null,
"color": "PINK"
}]
}]
}