# Troubleshooting API Calls to Retrieve ML Backend Predictions

**URL:** <https://community.labelstud.io/t/troubleshooting-api-calls-to-retrieve-ml-backend-predictions/58>\
**Category:** Slack Archivist\
**Created:** [July 17, 2023, 3:50pm UTC](https://community.labelstud.io/t/troubleshooting-api-calls-to-retrieve-ml-backend-predictions/58 "2023-07-17T15:50:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Archivist](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Archivist](https://community.labelstud.io/u/Archivist)\
**Post date:** [July 17, 2023, 3:50pm UTC](https://community.labelstud.io/t/troubleshooting-api-calls-to-retrieve-ml-backend-predictions/58/1 "2023-07-17T15:50:07Z")

</div>

**Charlie Batchelor** : Hi - I have a working ML Backend for my LS project, and I can retrieve predictions via the UI. However, if I make a POST request to try and achieve the same result, I get a null response bogus prediction tied to the task, and the task subsequently fails to load. The shape of the request I’m making looks like:

```auto
curl -v -X POST "<http://localhost:8080/api/predictions>" \
-H 'Authorization: Token &lt;token&gt;' \
-H 'Content-Type: application/json' \
-d '{
  "task": "&lt;task_id&gt;", "model_version":"&lt;version&gt;" 
}'

```

And the response is:

```auto
{"id":703,"model_version":"1688068863","created_ago":"0 minutes","result":null,"score":null,"cluster":null,"neighbors":null,"mislabeling":0.0,"created_at":"2023-07-04T11:46:55.497033Z","updated_at":"2023-07-04T11:46:55.497052Z","task":6731}%  

```

Is my request badly formed? Any help with this would be much appreciated!

**Chris Hoge (HumanSignal)**: I’m not sure if you’ve dig in deeper. I know that there’s an issue with the ML backend where the model ID might be updated without your knowledge, and that can cause some issues (if the model prediction ID doesn’t match the one you requested, it will return a null result). This is something that’s on the roadmap to improve.

**Charlie Batchelor** : Hi @Chris Hoge (HumanSignal) - thanks for this! The solution turned out to be a little simpler than this. I marked my comment on it, helping another user [https://label-studio.slack.com/archives/C01VBREDGAY/p1688476737679009?thread\_ts=1684930029.645459&amp;cid=C01VBREDGAY|here](https://label-studio.slack.com/archives/C01VBREDGAY/p1688476737679009?thread_ts=1684930029.645459&amp;cid=C01VBREDGAY%7Chere).

Regarding the IDs, LS seems to apply a unique ID to each task across the whole LS instance, so distributed across all projects. The task IDs sent were fine, and the model version supplied with it got me all the predictions I wanted via a Python script 🙂

**Note** : _This post was generated by the Label Studio Archive Bot from a conversation in the [Label Studio Slack](https://slack.labelstud.io/?source=discourse), a gathering place for the Label Studio community. Someone in the community thought this was worth sharing!_

_If this post answered a question for you, hit the Like button - we use that to assess which posts to put into docs._
