Skip to content

Commit

Permalink
Added Access API
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Mar 26, 2012
1 parent 992a535 commit de06c1c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -65,6 +65,7 @@ Sections ready for use

* [Projects](https://github.com/37signals/bcx-api/blob/master/sections/projects.md)
* [People](https://github.com/37signals/bcx-api/blob/master/sections/people.md)
* [Accesses](https://github.com/37signals/bcx-api/blob/master/sections/accesses.md)
* [Messages](https://github.com/37signals/bcx-api/blob/master/sections/messages.md)
* [Comments](https://github.com/37signals/bcx-api/blob/master/sections/comments.md)
* [Todo lists](https://github.com/37signals/bcx-api/blob/master/sections/todolists.md)
Expand All @@ -74,7 +75,6 @@ Sections ready for use
Concerns still under development
--------------------------------

* Access: Granting and revoking access to projects and calendars
* Calendars: Working with events
* Companies/Groups: Organize people in groups
* Documents: Collaborative texts
Expand All @@ -83,6 +83,7 @@ Concerns still under development
* Uploads/Attachments: Uploading and downloading of files
* Notifications: Letting people know by email if new content was added
* Trashing: Deleting content
* Moving todos and todolists: Changing their position in the UI


Help us make it better
Expand Down
54 changes: 54 additions & 0 deletions sections/accesses.md
@@ -0,0 +1,54 @@
Accesses
========

> <Clever quote about accesses>

Get accesses
------------

* `GET /projects/1/accesses.json` will return all the people with access to the project.

```json
[
{
"id": 149087659,
"name": "Jason Fried",
"email_address": "jason@37signals.com",
"updated_at": "2012-03-22T16:56:48-05:00",
"url": "https://basecamp.com/735644780/api/v1/people/149087659-jason-fried.json"
},
{
"id": 1071630348,
"name": "Jeremy Kemper",
"email_address": "jeremy@37signals.com",
"updated_at": "2012-03-22T16:56:48-05:00",
"url": "https://basecamp.com/735644780/api/v1/people/1071630348-jeremy-kemper.json"
}
]
```


Grant access
------------

* `POST /projects/1/accesses.json` will grant access to the project for the existing `ids` of people already on the account or new people via `email_addresses`.

```json
{
"ids": [ 5, 6, 10 ],
"email_addresses": [ "someone@example.com", "someoneelse@example.com" ]
}
```

You can get the ids of existing people on the account from the [people API](https://github.com/37signals/bcx-api/blob/master/sections/people.md).

This will return `200 OK` if the access was granted successfully. If the user does not have access to grant further access to the project, `403 Forbidden` will be returned.


Revoke access
-------------

* `DELETE /projects/1/accesses/1.json` will revoke the access of the person who's id is mentioned in the URL.

This will return `200 OK` if the revoke was a success. If the user does not have access to revoke access from the project, `403 Forbidden` will be returned.

0 comments on commit de06c1c

Please sign in to comment.