# Bond-async returning error

**URL:** https://forum.bondhome.io/t/bond-async-returning-error/3686
**Category:** Uncategorized
**Created:** [December 12, 2022, 5:17pm UTC](https://forum.bondhome.io/t/bond-async-returning-error/3686 "2022-12-12T17:17:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tfcbbond](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@tfcbbond](https://forum.bondhome.io/u/tfcbbond)
#### Post date: [December 12, 2022, 5:17pm UTC](https://forum.bondhome.io/t/bond-async-returning-error/3686/1 "2022-12-12T17:17:10Z")

</div>

I’m using:

> **[GitHub - bondhome/bond-async: Asynchronous Python wrapper library over Bond...](https://github.com/bondhome/bond-async)**
>
> Asynchronous Python wrapper library over Bond Local API - GitHub - bondhome/bond-async: Asynchronous Python wrapper library over Bond Local API

with Python 3.9.2 (on a linux system)

I ran the Library Usage example program and received the following. Is there a compatibility issue?

Thanks.

Version:  
{‘target’: ‘zermatt’, ‘fw\_ver’: ‘v3.8.4’, ‘fw\_date’: ‘Thu Nov 10 15:16:25 UTC 2022’, ‘uptime\_s’: 12343, ‘make’: ‘Olibra’, ‘model’: ‘BD-1000’, ‘branding\_profile’: ‘OLIBRA\_BD1000’, ‘bondid’: ‘ZZFxxxx’, ‘upgrade\_http’: True, ‘api’: 2, ‘\_’: ‘xxx’, ‘\_\_’: ‘xxx’}  
Device IDs:  
Client response error: 401, message=‘Unauthorized’, url=URL(‘[http://192.168.1.209/v2/devices](http://192.168.1.209/v2/devices)’)

---

<div class="post-metadata">

### Author: ![endy](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/endy/32/1275_2.png) [@endy](https://forum.bondhome.io/u/endy)
#### Post date: [December 15, 2022, 1:44am UTC](https://forum.bondhome.io/t/bond-async-returning-error/3686/2 "2022-12-15T01:44:42Z")

</div>

Hey @tfcbbond

I’m not sure how this works, but it looks like there is some problem with your authorization.  
I tested it over here and I can perform a GET to the version endpoint with an invalid Token, but can’t do it on the devices endpoint.

Can you double-check your Bond Token? If that doesn’t fix it, I can check with @marcio next week (he’s out this week).

Thank you!

---

<div class="post-metadata">

### Author: ![tfcbbond](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@tfcbbond](https://forum.bondhome.io/u/tfcbbond)
#### Post date: [December 15, 2022, 2:50am UTC](https://forum.bondhome.io/t/bond-async-returning-error/3686/3 "2022-12-15T02:50:17Z")

</div>

Ah, it wasn’t a token issue but rather how I entered the IP address and token.

The sample code includes the line:

bond = Bond(“[your ip or hostname here]”, “[your bond API token here]”)

Not being a Python programmer I simply assumed (bad idea) that the IP address and token were to be inserted between the symbols (as I recall that is a list in Python…could be very wrong). So the solution is quite simple:

bond = Bond(“your ip or hostname here”, “your bond API token here”)

The above works just fine for me.

Thanks.

---

<div class="post-metadata">

### Author: ![endy](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/endy/32/1275_2.png) [@endy](https://forum.bondhome.io/u/endy)
#### Post date: [December 15, 2022, 3:04am UTC](https://forum.bondhome.io/t/bond-async-returning-error/3686/4 "2022-12-15T03:04:56Z")

</div>


