# New to API, 403 Errors

**URL:** <https://meta.discourse.org/t/new-to-api-403-errors/67841>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [August 10, 2017, 10:06pm UTC](https://meta.discourse.org/t/new-to-api-403-errors/67841 "2017-08-10T22:06:11Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![donlucas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/donlucas/32/120794_2.png) [@donlucas](https://meta.discourse.org/u/donlucas)\
**Post date:** [August 10, 2017, 10:06pm UTC](https://meta.discourse.org/t/new-to-api-403-errors/67841/1 "2017-08-10T22:06:11Z")

</div>

Trying to add a member to a group and not finding a solution in the meta forums.  
(using python’s requests module)

> `requests.put('https://my.discourse.com/groups/the_group/members.json', data='{"usernames": "newForumUser", "api_key": "theGeneratedAPIKeyForUserNamedanAdmin", "api_username": "anAdmin"}', headers={"Content-Type":"application/json"}`

I get a 403 Forbidden response from the server. The api\_username is a site admin. If I try the command using curl:

> `curl -X POST "https://my.discourse.com/groups/the_group/members.json" -H "Content-Type: multipart/form-data;" -F "api_key=theGeneratedAPIKeyForUserNamedanAdmin" -F "api_username=anAdmin" -F "usernames=newForumUser"`

the html returned is Oops! That page doesn’t exist or is private.

I must be missing something obvious from [http://docs.discourse.org](http://docs.discourse.org)?

---

_[View the full topic](https://meta.discourse.org/t/new-to-api-403-errors/67841)._
