Twitch CLI Mock-API - End Prediction - Response 200 but Data Prediction not Updated/Ended

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"
        }]
    }]
}

Probably want to file this on the CLI Github GitHub - twitchdev/twitch-cli: The official Twitch CLI to make developing on Twitch easier.

Thanks for the guidance, done so and will wait to see. If anyone sees this and has experience with this on the forums though I would love to get your advice or thoughts.

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://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"
        }]
    }]
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.