# Making singleton calls for getting data

**URL:** <https://discourse.getcockpit.com/t/making-singleton-calls-for-getting-data/2445>\
**Category:** Cockpit v2\
**Created:** [August 14, 2022, 3:51pm UTC](https://discourse.getcockpit.com/t/making-singleton-calls-for-getting-data/2445 "2022-08-14T15:51:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsadowski](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@lsadowski](https://discourse.getcockpit.com/u/lsadowski)\
**Post date:** [August 14, 2022, 3:51pm UTC](https://discourse.getcockpit.com/t/making-singleton-calls-for-getting-data/2445/1 "2022-08-14T15:51:16Z")

</div>

Hey,

I got some trouble with making get request to get data from Singleton. In new docs I didn`t find anything on this subject.

So if for content request looks GET /content/item/{model} for singleton it should be GET /singleton/item/{singleton name} ??

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [August 15, 2022, 9:09am UTC](https://discourse.getcockpit.com/t/making-singleton-calls-for-getting-data/2445/2 "2022-08-15T09:09:06Z")

</div>

```auto
GET /content/item/{model}

```

to get the content for a singleton model. Please make sure that the singleton state is set to “published”

---

<div class="post-metadata">

**Author:** ![russellfeeed](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/russellfeeed/32/110_2.png) [@russellfeeed](https://discourse.getcockpit.com/u/russellfeeed)\
**Post date:** [August 22, 2022, 4:46pm UTC](https://discourse.getcockpit.com/t/making-singleton-calls-for-getting-data/2445/3 "2022-08-22T16:46:06Z")

</div>

Having trouble too

In both my code and the playground I get

```auto
{
  "error": "Permission denied"
}

```

when calling `GET /content/item/TermsAndConditions1`

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [August 22, 2022, 9:15pm UTC](https://discourse.getcockpit.com/t/making-singleton-calls-for-getting-data/2445/4 "2022-08-22T21:15:10Z")

</div>

If you don’t use an API-Key for the REST requests, then make sure that you assign a role to the public access user (settings \> api & security) that has read permissions for the targeted content model

---

<div class="post-metadata">

**Author:** ![russellfeeed](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/russellfeeed/32/110_2.png) [@russellfeeed](https://discourse.getcockpit.com/u/russellfeeed)\
**Post date:** [August 23, 2022, 1:09pm UTC](https://discourse.getcockpit.com/t/making-singleton-calls-for-getting-data/2445/5 "2022-08-23T13:09:01Z")

</div>

Can You confirm if the correct header for passing the APi key please?

Cockpit-Token

or

api-key?

TIA

---

<div class="post-metadata">

**Author:** ![russellfeeed](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/russellfeeed/32/110_2.png) [@russellfeeed](https://discourse.getcockpit.com/u/russellfeeed)\
**Post date:** [August 23, 2022, 1:25pm UTC](https://discourse.getcockpit.com/t/making-singleton-calls-for-getting-data/2445/6 "2022-08-23T13:25:14Z")

</div>

From experimentation it looks like it is now the `api-key` Header

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [August 24, 2022, 10:21am UTC](https://discourse.getcockpit.com/t/making-singleton-calls-for-getting-data/2445/7 "2022-08-24T10:21:45Z")

</div>

Yepp, 👉`api-key` is correct
