# Fast and easy way to test the Fibery API using Postman

**URL:** https://community.fibery.io/t/fast-and-easy-way-to-test-the-fibery-api-using-postman/1658
**Category:** API & Programming
**Created:** [May 26, 2021, 1:07pm UTC](https://community.fibery.io/t/fast-and-easy-way-to-test-the-fibery-api-using-postman/1658 "2021-05-26T13:07:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)
#### Post date: [May 26, 2021, 1:07pm UTC](https://community.fibery.io/t/fast-and-easy-way-to-test-the-fibery-api-using-postman/1658/1 "2021-05-26T13:07:17Z")

</div>

I hit a few hurdles getting my first API request to work in Postman so I figured I would throw together a quick guide for anyone that wants to try out the API but isn’t a developer or doesn’t want to use cURL.

# Getting your API token

This process will [very likely change in the future](https://api.fibery.io/#generate-a-new-token) but for now:

1. Open a tab to your https://YOUR\_ACCOUNT\_HERE.fibery.io/ page
2. Open the developer console by pressing `F12` or `Cmd+Opt+J` on Mac ([more info here](https://javascript.info/devtools))
3. Paste in the code below (WARNING: you should never run unknown console commands, the one below is copy pasted from the official API)

```auto
fetch(`https://${window.location.host}/api/tokens`, { method: 'POST' })
  .then(res => res.json())
  .then(obj => console.log("Your API token:", obj.value));

```

1. If your token isn’t printed in the console you might have to click on one of the messages to see it. End result should look something like below. Temporarily copy your API token somewhere secure.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/8/852f8c3bf0fed7db362509c68753bf47fecc7d01.png)

# Setting up Fibery authentication in your Postman collection

1. Create a new collection in Postman

2. In the Authorization tab, for **Type** select API Key for **Key** enter `Authorization`, for **Value** enter `Token {{token}}` and **Add to** should be Header  

3. Head over to the Variables tab and create a new **Variable** `token` with the **Initial Value** set to whatever your API token was  

4. Click Save

# Sending an API request

1. Create a new request in your Fibery collection and under the requests Authorization tab make sure the **Type** is set to Inherit auth from parent
2. a) Set the request type to POST, b) set the request URL to `https://YOUR_ACCOUNT_HERE.fibery.io/api/commands` and c) under Headers tab add a header with the **Key** of `Content-Type` and a **Value** of `application/json`  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/6/6c6a5fa9bf3253565715c0e49156e67be96e1d65.png)
3. Head over to the request’s Body tab and select raw. You should now be able to enter and send your API request. For example, here is how you [get the schema](https://api.fibery.io/#get-schema):  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/1/1675fbff9028b5b6bfb18652774be2fbf7d0f698.png)

---

<div class="post-metadata">

### Author: ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)
#### Post date: [May 26, 2021, 1:56pm UTC](https://community.fibery.io/t/fast-and-easy-way-to-test-the-fibery-api-using-postman/1658/2 "2021-05-26T13:56:43Z")

</div>

By the way, is there a way to get all values in a table?

Similar to SQL: `SELECT * FROM table_name;`

I’m imagining it would be something like below. How far off am I?

```auto
"query": {
"q/from": "table_name",
"q/select": "*",
"q/limit": 3
}

```

---

<div class="post-metadata">

### Author: ![rothnic](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/rothnic/32/1850_2.png) [@rothnic](https://community.fibery.io/u/rothnic)
#### Post date: [May 26, 2021, 2:04pm UTC](https://community.fibery.io/t/fast-and-easy-way-to-test-the-fibery-api-using-postman/1658/3 "2021-05-26T14:04:01Z")

</div>

```auto
    {
    "command": "fibery.entity/query",
    "args": {
        "query": {
        "q/from": "<App Name>/<Type Name>",
        "q/select": ["<App Name>/Name", "<App Name>/<Field Name>"],
        "q/limit": "q/no-limit"
        }
    }
    }
]

```

This worked for me. There is a mention in the api docs about the special no-limit criteria.

Edit: Sorry, I misread. You want all columns, not all entities. Looks like selecting all fields isn’t supported based on the API documentation saying:

> query. **`q/select`** : Array of primitive Fields, entity Field objects, objects with entity collection Fields subqueries and entity collection Field aggregates.

---

<div class="post-metadata">

### Author: ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)
#### Post date: [May 26, 2021, 3:31pm UTC](https://community.fibery.io/t/fast-and-easy-way-to-test-the-fibery-api-using-postman/1658/4 "2021-05-26T15:31:48Z")

</div>

> [@Dimitri\_S](#):
>
> is there a way to get all values in a table?

No, not for all fields in an entity. You will need to [retrieve your workspace schema](https://api.fibery.io/?javascript#get-schema) and find all the field names in your type.

---

<div class="post-metadata">

### Author: ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)
#### Post date: [May 26, 2021, 4:39pm UTC](https://community.fibery.io/t/fast-and-easy-way-to-test-the-fibery-api-using-postman/1658/5 "2021-05-26T16:39:12Z")

</div>

I see. This is outside the scope of using Postman, but what’s a good approach here, to get the schema and cache it for some duration, making API calls against that cached version of the schema?

---

<div class="post-metadata">

### Author: ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)
#### Post date: [May 26, 2021, 5:02pm UTC](https://community.fibery.io/t/fast-and-easy-way-to-test-the-fibery-api-using-postman/1658/6 "2021-05-26T17:02:44Z")

</div>

> [@Dimitri\_S](#):
>
> what’s a good approach here, to get the schema and cache it for some duration, making API calls against that cached version of the schema?

I think that’s the best we can do at this point, but:

> It would be great if there was a (fast) API call to get the “version number” of the Workspace schema, so we could easily discover if our cached schema was out of date.  
> [Feature Request](https://community.fibery.io/t/api-get-schema-version-number/1660)
