# Comment créer une clé API sur le panneau d'administration

**URL:** <https://meta.discourse.org/t/how-to-create-an-api-key-on-the-admin-panel/87383>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [Mai 13, 2018, 11:15 UTC](https://meta.discourse.org/t/how-to-create-an-api-key-on-the-admin-panel/87383 "2018-05-13T23:15:50Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mattman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattman/32/119713_2.png) [@mattman](https://meta.discourse.org/u/mattman)\
**Post date:** [Mai 15, 2018, 2:11 UTC](https://meta.discourse.org/t/how-to-create-an-api-key-on-the-admin-panel/87383/6 "2018-05-15T02:11:46Z")

</div>

Oh, okay. Discourse was installed and setup for me so I didn’t see the step where the admin’s API key was generated.

I switched from application/json to form-data and got a different error, but it looks like I made it past the authentication step.

If I just included an api\_key then I got an error that either the key or username was wrong, which makes sense. If I include an api\_key and an api\_username then I get an error 422 “unprocessable entity” or an error 400 “invalid access” depending on what I put in the api\_username field.

What “username” am I supposed to use to identify an account? The user’s profile has two fields called “username” and the only one that’s populated is something that can be edited by the user.

I’m only allowing users to make a Discourse account by using SSO to pull in the account they already made on the Bubble app. There’s an “external ID” that seems to be the user’s unique ID from Bubble.

I tried replacing the api\_username field with external\_id but got the same “key or username is invalid” error.

---

_[View the full topic](https://meta.discourse.org/t/how-to-create-an-api-key-on-the-admin-panel/87383)._
