Afternoon, just going through the API examples for the Prediction Lifecycle flow, and noticed that the End Prediction when using Twitch CLI is returning a Status code of 200 but not updating the Prediction at all. Is this user error or expected behaviour of the CLI mock-api?
Create Prediction (copied and adjusted to local host for CLI testing - All secret/client info is temp data)
curl -X POST 'http://localhost:8080/mock/predictions' \
-H 'Authorization: Bearer d9993f07f5d392e' \
-H 'Client-Id: 18d701582dfd7b433819ba79646edc' \
-H 'Content-Type: application/json' \
-d '{
"broadcaster_id": "94542606",
"title": "What is your Gender?",
"outcomes": [
{
"title": "Male."
},
{
"title": "Female."
}
],
"prediction_window": 120
}'
This successfully creates the Prediction.
{
"data": [{
"id": "02602652-4cad-3e25-67f7-cb3c42883a16",
"broadcaster_id": "94542606",
"broadcaster_login": "komodohypedrake940",
"broadcaster_name": "KomodoHypeDrake940",
"title": "What is your Gender?",
"winning_outcome_id": null,
"prediction_window": 120,
"status": "ACTIVE",
"started_at": "2022-06-07T15:27:07Z",
"ended_at": null,
"locked_at": null,
"outcomes": [{
"id": "ed0c32ee-0dce-5242-c30b-61e06b3940da",
"title": "Male.",
"users": 0,
"channel_points": 0,
"top_predictors": null,
"color": "BLUE"
}, {
"id": "58ccdd11-08ae-098d-a529-d247ff133616",
"title": "Female.",
"users": 0,
"channel_points": 0,
"top_predictors": null,
"color": "PINK"
}]
}]
}
I then try to End the Prediction with the following…
curl -X PATCH 'http://localhost:8080/mock/predictions' \
-H 'Authorization: Bearer d9993f07f5d392e' \
-H 'Client-Id: 18d701582dfd7b433819ba79646edc' \
-H 'Content-Type: application/json' \
-d '{
"broadcaster_id": "94542606",
"id": "02602652-4cad-3e25-67f7-cb3c42883a16",
"status": "RESOLVED",
"winning_outcome_id": "ed0c32ee-0dce-5242-c30b-61e06b3940da"
}'
But the Response is just returning a status code 200 success without changing the Prediction data. (double checked this by using GET Predictions as well).
{
"data": [{
"id": "02602652-4cad-3e25-67f7-cb3c42883a16",
"broadcaster_id": "94542606",
"broadcaster_login": "komodohypedrake940",
"broadcaster_name": "KomodoHypeDrake940",
"title": "What is your Gender?",
"winning_outcome_id": null,
"prediction_window": 120,
"status": "ACTIVE",
"started_at": "2022-06-07T15:27:07Z",
"ended_at": null,
"locked_at": null,
"outcomes": [{
"id": "58ccdd11-08ae-098d-a529-d247ff133616",
"title": "Female.",
"users": 0,
"channel_points": 0,
"top_predictors": null,
"color": "PINK"
}, {
"id": "ed0c32ee-0dce-5242-c30b-61e06b3940da",
"title": "Male.",
"users": 0,
"channel_points": 0,
"top_predictors": null,
"color": "BLUE"
}]
}]
}