# Connect to API using c8y/Client library

**URL:** <https://community.cumulocity.com/t/connect-to-api-using-c8y-client-library/320>\
**Category:** Forum\
**Tags:** api, cumulocity\
**Created:** [March 20, 2022, 9:12am UTC](https://community.cumulocity.com/t/connect-to-api-using-c8y-client-library/320 "2022-03-20T09:12:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yousef.okasha](https://avatars.discourse-cdn.com/v4/letter/y/71c47a/32.png) [@yousef.okasha](https://community.cumulocity.com/u/yousef.okasha)\
**Post date:** [March 20, 2022, 9:12am UTC](https://community.cumulocity.com/t/connect-to-api-using-c8y-client-library/320/1 "2022-03-20T09:12:00Z")

</div>

#### What are trying to achieve? Please describe in detail.

I want to access the API via javascript using the c8y/client library.

#### Do you get any error messages? Please provide a **full error** message screenshot and log file.

 ![Screenshot (11)](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/c/5/c594f845080d9f96e8157f7a3592388a2b657c2e.png)

I’ve used the baseURL as https://\<TENANT\_ID\>.cumulocity.com  
const client = await Client.authenticate({tenant,user,password}, baseUrl);

---

<div class="post-metadata">

**Author:** ![Christian\_Guether1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/christian_guether1/32/14848_2.png) [@Christian\_Guether1](https://community.cumulocity.com/u/Christian_Guether1)\
**Post date:** [March 29, 2022, 8:57am UTC](https://community.cumulocity.com/t/connect-to-api-using-c8y-client-library/320/2 "2022-03-29T08:57:52Z")

</div>

Hi Yousef,

I will close this topic as the issue is related to this [discussion](https://community.cumulocity.com/t/unable-to-access-api-via-postman/3873/26).

Best regards  
Christian

---

<div class="post-metadata">

**Author:** ![Christian\_Guether1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/christian_guether1/32/14848_2.png) [@Christian\_Guether1](https://community.cumulocity.com/u/Christian_Guether1)\
**Post date:** [March 29, 2022, 8:58am UTC](https://community.cumulocity.com/t/connect-to-api-using-c8y-client-library/320/3 "2022-03-29T08:58:00Z")

</div>

Closed on March 29, 2022, 8:58am UTC


