# Access Knack object properties via API

**URL:** <https://forums.knack.com/t/access-knack-object-properties-via-api/10026>\
**Category:** API & Custom Code\
**Created:** [December 2, 2017, 12:40am UTC](https://forums.knack.com/t/access-knack-object-properties-via-api/10026 "2017-12-02T00:40:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CarlMasri03739](https://avatars.discourse-cdn.com/v4/letter/c/41988e/32.png) [@CarlMasri03739](https://forums.knack.com/u/CarlMasri03739)\
**Post date:** [December 2, 2017, 12:40am UTC](https://forums.knack.com/t/access-knack-object-properties-via-api/10026/1 "2017-12-02T00:40:08Z")

</div>

Hi all,

I'm wondering if anyone knows how to get a list of all the properties for a specific object using Knack's API? For example, if I have an object called `Reports`, and it has a M/C field called `MyOptions` with `Option 1`, `Option 2`, and `Option 3` as the possible values, is there an API request that would return information about this object like so:

```
{
"object": "Reports",
"fields": [
0: {
"id": "field_23",
"name": "MyOptions",
"type": "M/C",
"values": [
"Option 1",
"Option 2",
"Option 3"
]
},
1: {
...
},
...
]
}
```

I can't find anything in the developer docs that suggests that this is possible, but it seems like a pretty important feature to omit. Any suggestions would be much appreciated.

---

<div class="post-metadata">

**Author:** ![CarlMasri03739](https://avatars.discourse-cdn.com/v4/letter/c/41988e/32.png) [@CarlMasri03739](https://forums.knack.com/u/CarlMasri03739)\
**Post date:** [December 4, 2017, 9:22pm UTC](https://forums.knack.com/t/access-knack-object-properties-via-api/10026/2 "2017-12-04T21:22:28Z")

</div>

Yep, that's the one. Thanks Conan!

---

<div class="post-metadata">

**Author:** ![ConanCrawf94809](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/conancrawf94809/32/659_2.png) [@ConanCrawf94809](https://forums.knack.com/u/ConanCrawf94809)\
**Post date:** [December 4, 2017, 8:53pm UTC](https://forums.knack.com/t/access-knack-object-properties-via-api/10026/3 "2017-12-04T20:53:03Z")

</div>

Using the API Key in a server request, you can get the entire application object which has what you want. So like in express using axios, here's what I would do:

const applicationId = `xxxxxxx`  
const resourceUrl = `[https://api.knack.com/v1/applications/${applicationId}`](https://api.knack.com/v1/applications/%24%7BapplicationId%7D%60)  
  
// ~server/api/application.js  
// your-router-function-here ...  
  
axios.get(resourceUrl)  
&nbsp; .then(( {data} ) =\> {  
  
&nbsp; &nbsp; const objectsArray = data.application.objects  
&nbsp; &nbsp; const&nbsp;reportsObject = objectsArray.find(o =\> o.name ===&nbsp;'Reports')  
&nbsp; &nbsp; if (reportsObject) {  
&nbsp; &nbsp; &nbsp; &nbsp;const myOptionsFieldObject = reportsObject.fields.find(f =\> f.name === 'MyOptions')  
&nbsp; &nbsp; &nbsp; &nbsp;const optionsArray =&nbsp;myOptionsFieldObject.format.options  
&nbsp; &nbsp; &nbsp; &nbsp;res.json(optionsArray)  
&nbsp; &nbsp; }

Obviously you will want error checking and closure in that snippet, but the take away should be that you want to get the application object from the url:

[https://api.knack.com/v1/applications/my-application-id-here](https://api.knack.com/v1/applications/my-application-id-here)

then use this super crude object path:

application.objects.fields.format.options
