# Method Not Allowed Error Hosted API

**URL:** <https://discuss.roboflow.com/t/method-not-allowed-error-hosted-api/1614>\
**Category:** 🤝  Community Help\
**Created:** [March 6, 2023, 3:16pm UTC](https://discuss.roboflow.com/t/method-not-allowed-error-hosted-api/1614 "2023-03-06T15:16:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AhmetAksunger](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/ahmetaksunger/32/1354_2.png) [@AhmetAksunger](https://discuss.roboflow.com/u/AhmetAksunger)\
**Post date:** [March 6, 2023, 3:16pm UTC](https://discuss.roboflow.com/t/method-not-allowed-error-hosted-api/1614/1 "2023-03-06T15:16:25Z")

</div>

When I try to connect to my trained models API in order to use it on visual studio code, I get an error which in summary says HTTPError: 405 Client Error: Method Not Allowed for URL:

I get this error even though I filled my API key, MODEL\_ENDPOINT and version correctly, by double-checking from the “Use curl command” section.

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [March 7, 2023, 1:39am UTC](https://discuss.roboflow.com/t/method-not-allowed-error-hosted-api/1614/2 "2023-03-07T01:39:59Z")

</div>

answered your question on your other post, here: [Error occuring while trying the API - #2 by Mohamed](https://discuss.roboflow.com/t/error-occuring-while-trying-the-api/1617/2)

---

<div class="post-metadata">

**Author:** ![James\_Vance](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/james_vance/32/3160_2.png) [@James\_Vance](https://discuss.roboflow.com/u/James_Vance)\
**Post date:** [October 29, 2023, 11:28pm UTC](https://discuss.roboflow.com/t/method-not-allowed-error-hosted-api/1614/3 "2023-10-29T23:28:20Z")

</div>

I’m having the exact same issue of the 405. Using a workflow same as here

```auto
https://blog.roboflow.com/python-webcam/

```

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [October 30, 2023, 8:47pm UTC](https://discuss.roboflow.com/t/method-not-allowed-error-hosted-api/1614/4 "2023-10-30T20:47:00Z")

</div>

Hi @James_Vance

The model endpoint details have changed a bit since that post was published. For the most up-to-date details, check out our documentation, especially for the [object detection hosted API](https://docs.roboflow.com/deploy/hosted-api/object-detection).

One notable difference from the quick look I took at the blog post was that we no longer use the param `access_token` and we instead use `api_key`.

Let us know if you still have trouble solving your issue!

---

<div class="post-metadata">

**Author:** ![James\_Vance](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/james_vance/32/3160_2.png) [@James\_Vance](https://discuss.roboflow.com/u/James_Vance)\
**Post date:** [November 2, 2023, 12:06am UTC](https://discuss.roboflow.com/t/method-not-allowed-error-hosted-api/1614/5 "2023-11-02T00:06:42Z")

</div>

Thanks @leo the reason for the 405 was I wasn’t including the model number version like `https://detect.roboflow.com/csv-to-txt-mutvh?api_key=` instead of `https://detect.roboflow.com/csv-to-txt-mutvh/1?api_key=`.

Now, when I load the response as a bytearray (below)

```auto
image = np.asarray(bytearray(resp.raw.read()), dtype="uint8")

```

it all comes back in a 1D numpy array with length 7500. Do you know if there’s a reshape necessary of it this is model dependent? When running the model locally, it returns a structured text with the bounds, keypoints, etc

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [November 3, 2023, 4:01am UTC](https://discuss.roboflow.com/t/method-not-allowed-error-hosted-api/1614/6 "2023-11-03T04:01:54Z")

</div>

Hi @James_Vance

Could you provide the exact code and/or URL that you are requesting the API with? I don’t believe it should come back as a numpy array. It’d also be helpful to see examples of the array and the structured text you mentioned.
