# API GET Command

**URL:** <https://forums.knack.com/t/api-get-command/8781>\
**Category:** Ask Developers\
**Created:** [June 26, 2020, 4:48pm UTC](https://forums.knack.com/t/api-get-command/8781 "2020-06-26T16:48:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard20805](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/richard20805/32/554_2.png) [@Richard20805](https://forums.knack.com/u/Richard20805)\
**Post date:** [June 26, 2020, 4:48pm UTC](https://forums.knack.com/t/api-get-command/8781/1 "2020-06-26T16:48:16Z")

</div>

Please would somebody help me make my first API call.&nbsp; I have tried asking support for help, they pointed me here

I want to use web services to read a record, should be simple.&nbsp; I can see the record(s) here

[https://builder.knack.com/hht/asset#data/object\_1/records](https://builder.knack.com/hht/asset#data/object_1/records)

So far my best try is

[https://api.knack.com/v1/objects/object\_1/records?X-Knack-Application-Id=\<value](https://api.knack.com/v1/objects/object_1/records?X-Knack-Application-Id=<value) here\> &X-Knack-REST-API-KEY=\<value here\>

&nbsp;All I get back is 401 not authorised.

Regards Richard

---

<div class="post-metadata">

**Author:** ![Richard20805](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/richard20805/32/554_2.png) [@Richard20805](https://forums.knack.com/u/Richard20805)\
**Post date:** [June 26, 2020, 5:18pm UTC](https://forums.knack.com/t/api-get-command/8781/2 "2020-06-26T17:18:20Z")

</div>

Thanks, David it worked :)&nbsp;&nbsp;

{

&nbsp;&nbsp;&nbsp;&nbsp;"total\_pages":&nbsp;1,

&nbsp;&nbsp;&nbsp;&nbsp;"current\_page":&nbsp;1,

&nbsp;&nbsp;&nbsp;&nbsp;"total\_records":&nbsp;2,

&nbsp;&nbsp;&nbsp;&nbsp;"records":&nbsp;[

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"id":&nbsp;"5ef5c7dbce624100158a65db",

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"field\_1":&nbsp;"Asset&nbsp;2",

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"field\_1\_raw":&nbsp;"Asset&nbsp;2",

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"field\_2":&nbsp;"A002",

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"field\_2\_raw":&nbsp;"A002"

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"id":&nbsp;"5ef5c7bace624100158a656d",

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"field\_1":&nbsp;"Test&nbsp;Asset1",

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"field\_1\_raw":&nbsp;"Test&nbsp;Asset1",

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"field\_2":&nbsp;"A001",

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"field\_2\_raw":&nbsp;"A001"

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;]

}

---

<div class="post-metadata">

**Author:** ![hmnd](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/hmnd/32/190_2.png) [@hmnd](https://forums.knack.com/u/hmnd)\
**Post date:** [June 26, 2020, 4:52pm UTC](https://forums.knack.com/t/api-get-command/8781/3 "2020-06-26T16:52:48Z")

</div>

Hey Richard,

The issue with your request is that the X-Knack-Application-Id and X-Knack-REST-API-KEY are headers and need to be sent as such instead of as part of the URL. If you are using jQuery ajax ($.get or $.ajax), you can provide these headers under the header key in your options.

Please do note, however, that you should not use your API key in any client-side code (the Javascript section of your Knack app). Instead, use view-based API calls, as described [here](https://www.knack.com/developer-documentation/#retrieving-multiple-records-view-based-get).

Feel free to reach out at [david@hmnd.io](mailto:david@hmnd.io) if you need any further assistance with this or anything else.
