# Trouble WIth API Call to Get Project Devices

**URL:** <https://discuss.blues.com/t/trouble-with-api-call-to-get-project-devices/2010>\
**Category:** Troubleshooting\
**Created:** [March 3, 2024, 5:48am UTC](https://discuss.blues.com/t/trouble-with-api-call-to-get-project-devices/2010 "2024-03-03T05:48:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradleyward](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/bradleyward/32/1119_2.png) [@bradleyward](https://discuss.blues.com/u/bradleyward)\
**Post date:** [March 3, 2024, 5:48am UTC](https://discuss.blues.com/t/trouble-with-api-call-to-get-project-devices/2010/1 "2024-03-03T05:48:18Z")

</div>

New user here. I am using the Notehub API for the first time. I have successfully implemented the OAuth call to get an access token.

I am getting this back from the OAuth call:

access\_token : GdeskJ5F8uzCmnM2lFDVI\_kHa6xVm-182B2XuJyJuUQ.VWmLQtZRVPyHiANFTzIxw\_ds4oB\_\_bbmYnPWnEnre0s  
expires\_in : 1799  
scope :  
token\_type : bearer

Immediately after that successful OAuth call, I call the projects/devices endpoint to retrieve the devices in my project.

I am setting the “Authorization” request header to:

Bearer {GdeskJ5F8uzCmnM2lFDVI\_kHa6xVm-182B2XuJyJuUQ.VWmLQtZRVPyHiANFTzIxw\_ds4oB\_\_bbmYnPWnEnre0s}

And the URL I am calling is:

[https://api.notefile.net/v1/projects/](https://api.notefile.net/v1/projects/)\<my.project.id\>/devices

The response I am getting is “NotFound”.

It would seem that this means that it is not finding my project (the URL does not map to an existing project).

Is [https://api.notefile.net/v1/projects/](https://api.notefile.net/v1/projects/)\<my.project.id\>/devices still the correct URL for this API call?

If it is, what else should I check to determine why this is not working?

Thanks,

Brad

---

<div class="post-metadata">

**Author:** ![Pius4109](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@Pius4109](https://discuss.blues.com/u/Pius4109)\
**Post date:** [March 3, 2024, 7:36pm UTC](https://discuss.blues.com/t/trouble-with-api-call-to-get-project-devices/2010/2 "2024-03-03T19:36:02Z")

</div>

> [@bradleyward](#):
>
> [https://api.notefile.net/v1/projects/](https://api.notefile.net/v1/projects/)\<my.project.id\>/devices

I just did a quick check, but i couldn’t find this URL [https://api.notefile.net/v1/projects/](https://api.notefile.net/v1/projects/)\<my.project.id\>/devices in the notehub API reference. It is either I missed it or it doesn’t exist. You can check for yourself at : [Notehub API Introduction - Blues Developers](https://dev.blues.io/api-reference/notehub-api/api-introduction/)

---

<div class="post-metadata">

**Author:** ![bradleyward](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/bradleyward/32/1119_2.png) [@bradleyward](https://discuss.blues.com/u/bradleyward)\
**Post date:** [March 3, 2024, 9:28pm UTC](https://discuss.blues.com/t/trouble-with-api-call-to-get-project-devices/2010/3 "2024-03-03T21:28:13Z")

</div>

Thanks for the reply, Pius4109. The call I am making is a part of the Device API in the Notehub section. It is documented here: The “Get Devices” call at the top of the page.

> **[Device API - Notehub API Reference - Blues Developers](https://dev.blues.io/api-reference/notehub-api/device-api/)**
>
> The Notehub device API provides RESTful methods that can be used to GET, POST, and DELETE data related to devices.

Now I will admit that I did not specifically see the official root part of the API URL documented anywhere. I just used the URL format shown i the CURL command assuming it would be the same. But that too may be a flawed assumption. I will look again for official documentation.

I chose it because after a rapid and totally non-thorough scan of the docs, it was an API call that looked as simple as any as it had no arguments other than the ProjectUUID in the URL.

I think I will go scan the docs again and see if I can find another one to try. At this early stage of just familiarizing myself with the API’s and how they work, any API call will do. If you or anyone else has a suggestion for a nice, simple call to invoke in my sandbox code, I’d appreciate it!

Thanks again,

Brad

---

<div class="post-metadata">

**Author:** ![bradleyward](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/bradleyward/32/1119_2.png) [@bradleyward](https://discuss.blues.com/u/bradleyward)\
**Post date:** [March 4, 2024, 3:11am UTC](https://discuss.blues.com/t/trouble-with-api-call-to-get-project-devices/2010/4 "2024-03-04T03:11:09Z")

</div>

I noticed that the NotFound reply included a JSON payload.Here is what that payload contained:

 ![2024-03-03_22-08-56](https://us1.discourse-cdn.com/flex020/uploads/blues/original/2X/7/76908e8dcf0bc06c0dd428c9779f409162412247.png)

---

<div class="post-metadata">

**Author:** ![bradleyward](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/bradleyward/32/1119_2.png) [@bradleyward](https://discuss.blues.com/u/bradleyward)\
**Post date:** [March 4, 2024, 3:29am UTC](https://discuss.blues.com/t/trouble-with-api-call-to-get-project-devices/2010/5 "2024-03-04T03:29:02Z")

</div>

OK, I figured out my problem. Definitely a first time user problem.

The problem: In constructing the URL to call, I was using the “ProductUID” instead of the “ProjectUID”.

You can find both on the Settings page for your Notehub project. Note that the ProjectUID is somewhat human readable (may start with your domain name listed in reverse), the Project UID is a cryptic machine generated UID.

Once I started using the Project UID in the URL it started working.

Issue closed.

Hope this helps someone else down the road.
