The City API v.1.0

Security & Authentication

Register your app or plugin

Go to Admin | API | Plugins | + Create Plugin

  • Title: name of your app.
  • URL: name of your app.
  • Admin URL: name of your app.
  • SSL: name of your app.
  • Image: name of your app.
  • Callback URL: name of your app.

Install your app or plugin

Go to Admin | Plugins | Available Plugins

Once you click install, your app will be in "sandbox" mode, meaning it will not show up in the main navigation for any of your users.

  • Title: name of your app.
  • URL: name of your app.
  • Admin URL: name of your app.
  • SSL: name of your app.
  • Image: name of your app.
  • Callback URL: name of your app.

Signing Requests

All requests to the API require an oauth access token to be passed along in the Authorization header:

  • Authorization: Bearer 3d7a691d4c88fadb6b670536bb6df298651dcaf88dfe6246306bb4749e7be18c

Examples of signing

Here is an example using the 'thecity' ruby gem:

require 'thecity'

client = TheCity::API::Client.new do |config|
  config.app_id        = "YOUR_APP_ID"
  config.app_secret    = "YOUR_APP_SECRET"
  config.access_token  = "OAUTH_ACCESS_TOKEN"
end

API Endpoints

Church Account

GET /church_account

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X GET https://api.onthecity.org/church_account

Notes

Returns data that helps you build UI with labels that respect a church's terminology, as well as hide features a church has turned off or disabled.

Required Scope

any

Required Permissions

none

Parameters

none

Return Data

HTTP 200 OK { "id": 1, "subdomain": "church", "name": "Church of the Hills", "terminology": { "neighborhood": "Borough", "pledge": "Pledge", "network": "Network", "service": "Service", "member": "Brotha", "campus": "Campus", "connect": "Connect", "church": "Church", "community": "Life", "staff": "Staff", "band": "Band", "seed": "Seed", "other": "Other", "redemption": "Redemption", "leader": "Leader" }, "campuses": [ { "name": "North Campus", "id": 46543, "type": "Campus", "profile_picture": "https://..../profile.jpg", "role_title": "Participant", "primary_campus": true },{ "name": "South Campus", "id": 442213, "type": "Campus", "profile_picture": "https://..../profile.jpg", "role_title": "Participant", "primary_campus": false } ] }

Events Show

GET /events/:id

Example

https://api.onthecity.org/events/1064462654

Notes

Returns an event.

Required Scope

group_content

Required Permissions

The current user must have an active role in the group where the event was originally posted, or an active role in a group the event was shared to, or the event needs to be shared directly to the current user.

The event has to have been created by the current app.

Parameters

none
    

Return Data

HTTP 200 OK { "title": "A really great event", "group_id": 839047027, "starting_at": "10/31/2012 08:30 PM (UTC)", "created_at": "10/16/2012 08:47 PM (UTC)", "ending_at": "10/31/2012 09:30 PM (UTC)", "id": 1064462654 }

Events Update

PUT /events/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X PUT https://api.onthecity.org/events/292743653 -d "title=Updated my Title"

Notes

Returns an event, and one page of any responses to the event.

Required Permissions

The current user must have an active role in the group where the event was originally posted, or an active role in a group the event was shared to, or the event needs to be shared directly to the current user.

User must have permission to edit the event (group leader or event author).

Parameters

body = ["The body text of the event"]

title = ["Event title"]
    

Return Data

HTTP 200 OK { "title": "A really great event", "group_id": 839047027, "starting_at": "10/31/2012 08:30 PM (UTC)", "created_at": "10/16/2012 08:47 PM (UTC)", "ending_at": "10/31/2012 09:30 PM (UTC)", "id": 1064462654 }

Events Destroy

DELETE /events/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X DELETE https://api.onthecity.org/events/145570352

Required Permissions

Current user must have an active role in the group.

Current user must have permission to delete this event (group leader or event author).

Parameters

N/A

Return Data

HTTP 204 EVENT SUCCESSFULLY DESTROYED

Groups | Topics Create

POST /groups/:group_id/topics/

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X POST https://api.onthecity.org/groups/839047027/topics -d "title=My Oh My!" -d "body=It's Grand Salami Time!"

Required Permissions

User must have an active role in the group.

User must have permission to create topics in the group.

Parameters

* body = ["The body text of the status update"]

* title = ["Topic title"]

shareable = [ true | false ]

leader_only = [ true | false ]

member_only = [ true | false ]

gender_only = [ true | false ]

limit_email = [ true | false ]

plaza = ['Private' | 'Public' ]

emergency = [ true | false ]

Return Data

HTTP 200 OK { "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 }, "not_respondable": false, "last_editor": null, "file_attachments": [], "member_only": false, "title": "a topic about a subject", "group_id": 839047027, "gender_only": false, "short_url": null, "recent_responses": [], "processed_body": "

This is going to really foster discussion

", "gender_only_gender": null, "leader_only": false, "shareable": false, "updated_at": "10/17/2012 06:09 AM (UTC)", "body": "This is going to really foster discussion", "blurb": "This is going to really foster discussion", "featured": false, "created_at": "10/17/2012 06:09 AM (UTC)", "plaza": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "nickname": "", "id": 946060874 }, "limit_email": false, "id": 1008408710, "shared_to_users": [], "shared_to_groups": [], "emergency": false } HTTP 400 {"error_code":400,"error_message":"Title can't be blank,Body can't be blank"}

Groups | Events Create

POST /groups/:group_id/events/

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X POST https://api.onthecity.org/groups/839047027/events -d '{"title":"An Awesome Event","body":"You should come to this!","starting_at":Mon Jan 14 13:09:55,"ending_at":1/14/12 3:09:55 PM,plaza":"private","emergency":true,"shareable":true,"items":[{"description":"Meats","total_quantity":25},{"description":"drinks", "total_quantity": 10}],"roles": [{"title": "clean-up"},{"title": "setup"}], share_to_groups":[1234,4567],"share_to_users":[123456,380377255], "share_comment":"Please accept this share!","member_only":true, "gender_only":true, "address":{"street":"12345 Main St.","city":"Nowhere"}}'

Required Permissions

User must have an active role in the group.

User must have permission to create events in the group.

Parameters

* body = [ "The body text of the event" ]

* title = [ "Event title" ]

* starting_at = []

* ending_at = [ "" | "" ]

shareable = [ true | false ]

leader_only = [ true | false ]

member_only = [ true | false ]

gender_only = [ true | false ]

limit_email = [ true | false ]

plaza = ['Private' | 'Public' ]

emergency = [ true | false ]

Return Data

HTTP 200 OK { "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 }, "not_respondable": false, "last_editor": null, "file_attachments": [], "member_only": false, "title": "a topic about a subject", "group_id": 839047027, "gender_only": false, "short_url": null, "recent_responses": [], "processed_body": "

This is going to really foster discussion

", "gender_only_gender": null, "leader_only": false, "shareable": false, "updated_at": "10/17/2012 06:09 AM (UTC)", "body": "This is going to really foster discussion", "blurb": "This is going to really foster discussion", "featured": false, "created_at": "10/17/2012 06:09 AM (UTC)", "plaza": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "nickname": "", "id": 946060874 }, "limit_email": false, "id": 1008408710, "shared_to_users": [], "shared_to_groups": [], "emergency": false } HTTP 400 {"error_code":400,"error_message":"Title can't be blank,Body can't be blank"}

Groups | Prayers Create

POST /groups/:group_id/prayers/

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X POST https://api.onthecity.org/groups/839047027/prayers -d "title=My Oh My!" -d "body=It's Grand Salami Time!"

Required Permissions

User must have an active role in the group.

User must have permission to create prayers in the group.

Parameters

* body = ["The body text of the prayer"]

* title = ["Prayer title"]

shareable = [ true | false ]

leader_only = [ true | false ]

member_only = [ true | false ]

gender_only = [ true | false ]

limit_email = [ true | false ]

plaza = ['Private' | 'Public' ]

emergency = [ true | false ]

Return Data

HTTP 200 OK { "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 }, "not_respondable": false, "last_editor": null, "file_attachments": [], "member_only": false, "title": "a topic about a subject", "group_id": 839047027, "gender_only": false, "short_url": null, "recent_responses": [], "processed_body": "

This is going to really foster discussion

", "gender_only_gender": null, "leader_only": false, "shareable": false, "updated_at": "10/17/2012 06:09 AM (UTC)", "body": "This is going to really foster discussion", "blurb": "This is going to really foster discussion", "featured": false, "created_at": "10/17/2012 06:09 AM (UTC)", "plaza": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "nickname": "", "id": 946060874 }, "limit_email": false, "id": 1008408710, "shared_to_users": [], "shared_to_groups": [], "emergency": false } HTTP 400 {"error_code":400,"error_message":"Title can't be blank,Body can't be blank"}

Groups | Needs Create

POST /groups/:group_id/needs/

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X POST https://api.onthecity.org/groups/839047027/needs -d '{"title":"Valkyrie Needs Food, Badly","body":"Please sign up to bring her food.","plaza":"private","emergency":true,"shareable":true,"items":[{"description":"monday","starting_at":"10/13/2013"},{"description":"tuesday"}],"share_to_groups":[1234,4567],"share_to_users":[123456,380377255], "share_comment":"Please accept this share!","member_only":true, "gender_only":true, "address":{"street":"12345 Main St.","city":"Nowhere"}}'

Required Permissions

User must have an active role in the group.

User must have permission to create needs in the group.

Parameters

* body = ["The body text of the need"]

* title = ["Need title"]

leader_only = [ true | false ]

member_only = [ true | false ]

gender_only = [ true | false ]

limit_email = [ true | false ]

plaza = ['Private' | 'Public' ]

emergency = [ true | false ]

items = [

    * description = ["Need item description"]

    starting_at = ["dd/mm/yyyy" | "yyyy-mm-dd"]

]

shareable = [ true | false ]

share_to_groups = [ [1234, 2345] ] <-- Array of group IDs

share_to_users = [ [1234, 2345] ] <-- Array of user IDs

share_comment = ["A comment string to the shared_to approver"]

Return Data

HTTP 200 OK { "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 }, "not_respondable": false, "last_editor": null, "file_attachments": [], "member_only": false, "title": "a topic about a subject", "group_id": 839047027, "gender_only": false, "short_url": null, "recent_responses": [], "processed_body": "

This is going to really foster discussion

", "gender_only_gender": null, "leader_only": false, "shareable": false, "updated_at": "10/17/2012 06:09 AM (UTC)", "body": "This is going to really foster discussion", "blurb": "This is going to really foster discussion", "featured": false, "created_at": "10/17/2012 06:09 AM (UTC)", "plaza": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "nickname": "", "id": 946060874 }, "limit_email": false, "id": 1008408710, "shared_to_users": [], "shared_to_groups": [], "emergency": false } HTTP 400 {"error_code":400,"error_message":"Title can't be blank,Body can't be blank"}

Me Show

GET /me

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X GET http://api.onthecity.org/me"

Notes

Returns basic user information for the current user.

Required Permissions

N/A

Parameters

N/A

Return Data

HTTP 200 OK { "id": 718883779, "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Another Service Group" }

Me Permissions

GET /me/permissions

Example

https://api.onthecity.org/me/permissions

Notes

Returns data that helps you determine what level of access, content creation, and permissions the current user has. can_create_in_group_ids returns an array of group ids that this user can create specific content types in.

Required Permissions

N/A

Parameters

N/A

Return Data

HTTP 200 OK { "member":true, "staff":true, "can_list_in_plaza":true, "admin":true, "can_create_in_group_ids": { "topics": [1001864604,900637201,703083797,718883779,823956377, 49861013,114380847,1023606148,604649789,839047027, 695668407,264535063,935266297,494538351,153639016], "needs": [1001864604,900637201,703083797,718883779,823956377, 49861013,114380847,1023606148,604649789,839047027], "albums": [1001864604,900637201], "prayers": [604649789,839047027,695668407,264535063,935266297,494538351], "events": [1001864604,900637201,703083797,718883779,823956377, 839047027,695668407,264535063,935266297,494538351,153639016] } }

Me | Groups Index

GET /me/groups

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X GET https://api.onthecity.org/me/groups

Notes

Returns an array of the groups the current user has active roles in.

Required Permissions

N/A

Parameters

N/A

Return Data

HTTP 200 OK [ { "name":"3rd & 4th Grade", "id":900637201 },{ "name":"1st & 2nd Grade", "id":1001864604 },{ "name":"A Service Group", "id":703083797 },{ "name":"Johns Community Group", "id":839047027 } ]

Needs Show

GET /needs/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X GET http://api.onthecity.org/needs/292743653/

Notes

Returns a need, and one page of any responses to the need.

Required Permissions

The current user must have an active role in the group where the need was originally posted, or an active role in a group the need was shared to, or the need needs to be shared directly to the current user.

Parameters

page = [1,2,3,...] <-- for paging through responses
    

Return Data

HTTP 200 OK { "responses": { "per_page": 20, "total_pages": 1, "current_page": 1, "total_entries": 1, "responses": [ { "last_editor": null, "processed_body": "

Im praying too!

", "updated_at": "10/16/2012 11:19 PM (UTC)", "created_at": "10/16/2012 11:19 PM (UTC)", "blurb": "Im praying too!", "body": "

Im praying too!

", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "nickname": "", "id": 946060874 }, "id": 1069956082 } ] }, "not_respondable": false, "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 }, "member_only": false, "file_attachments": [], "last_editor": null, "group_id": 839047027, "title": "This is a simple need", "short_url": null, "gender_only": false, "gender_only_gender": null, "processed_body": "

Which are often the best

", "updated_at": "10/16/2012 11:19 PM (UTC)", "emergency": false, "shareable": true, "leader_only": false, "plaza": false, "created_at": "09/25/2012 07:03 PM (UTC)", "featured": false, "blurb": "Which are often the best", "body": "Which are often the best", "id": 292743653, "limit_email": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045524/markblair_thumb.png?1259810616", "last": "Leaderman", "title": null, "middle": "", "first": "John", "nickname": "", "id": 830138774 }, "shared_to_groups": [], "shared_to_users": [] }

Needs Update

PUT /needs/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X PUT https://api.onthecity.org/needs/292743653 -d "title=Updated my Title"

Notes

Returns a need, and one page of any responses to the need.

Required Permissions

The current user must have an active role in the group where the need was originally posted, or an active role in a group the need was shared to, or the need needs to be shared directly to the current user.

User must have permission to edit the need (group leader or need author).

Parameters

body = ["The body text of the need"]

title = ["Need title"]
    

Return Data

HTTP 200 OK { "responses": { "per_page": 20, "total_pages": 1, "current_page": 1, "total_entries": 1, "responses": [ { "last_editor": null, "processed_body": "

Im praying too!

", "updated_at": "10/16/2012 11:19 PM (UTC)", "created_at": "10/16/2012 11:19 PM (UTC)", "blurb": "Im praying too!", "body": "

Im praying too!

", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "nickname": "", "id": 946060874 }, "id": 1069956082 } ] }, "not_respondable": false, "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 }, "member_only": false, "file_attachments": [], "last_editor": null, "group_id": 839047027, "title": "Updated my Title", "short_url": null, "gender_only": false, "gender_only_gender": null, "processed_body": "

Which are often the best

", "updated_at": "10/16/2012 11:19 PM (UTC)", "emergency": false, "shareable": true, "leader_only": false, "plaza": false, "created_at": "09/25/2012 07:03 PM (UTC)", "featured": false, "blurb": "Which are often the best", "body": "Which are often the best", "id": 292743653, "limit_email": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045524/markblair_thumb.png?1259810616", "last": "Leaderman", "title": null, "middle": "", "first": "John", "nickname": "", "id": 830138774 }, "shared_to_groups": [], "shared_to_users": [] }

Needs Destroy

DELETE /needs/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X DELETE https://api.onthecity.org/needs/145570352

Required Permissions

Current user must have an active role in the group.

Current user must have permission to delete this need (group leader or need author).

Parameters

N/A

Return Data

HTTP 204

Prayers Show

GET /prayers/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X GET http://api.onthecity.org/prayers/292743653/

Notes

Returns a prayer, and one page of any responses to the prayer.

Required Permissions

The current user must have an active role in the group where the prayer was originally posted, or an active role in a group the prayer was shared to, or the prayer needs to be shared directly to the current user.

Parameters

page = [1,2,3,...] <-- for paging through responses
    

Return Data

HTTP 200 OK { "responses": { "per_page": 20, "total_pages": 1, "current_page": 1, "total_entries": 1, "responses": [ { "last_editor": null, "processed_body": "

Im praying too!

", "updated_at": "10/16/2012 11:19 PM (UTC)", "created_at": "10/16/2012 11:19 PM (UTC)", "blurb": "Im praying too!", "body": "

Im praying too!

", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "nickname": "", "id": 946060874 }, "id": 1069956082 } ] }, "not_respondable": false, "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 }, "member_only": false, "file_attachments": [], "last_editor": null, "group_id": 839047027, "title": "This is a simple prayer", "short_url": null, "gender_only": false, "gender_only_gender": null, "processed_body": "

Which are often the best

", "updated_at": "10/16/2012 11:19 PM (UTC)", "emergency": false, "shareable": true, "leader_only": false, "plaza": false, "created_at": "09/25/2012 07:03 PM (UTC)", "featured": false, "blurb": "Which are often the best", "body": "Which are often the best", "id": 292743653, "limit_email": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045524/markblair_thumb.png?1259810616", "last": "Leaderman", "title": null, "middle": "", "first": "John", "nickname": "", "id": 830138774 }, "shared_to_groups": [], "shared_to_users": [] }

Prayers Update

PUT /prayers/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X PUT https://api.onthecity.org/prayers/292743653 -d "title=Updated my Title"

Notes

Returns a prayer, and one page of any responses to the prayer.

Required Permissions

The current user must have an active role in the group where the prayer was originally posted, or an active role in a group the prayer was shared to, or the prayer needs to be shared directly to the current user.

User must have permission to edit the prayer (group leader or prayer author).

Parameters

body = ["The body text of the status update"]

title = ["Topic title"]
    

Return Data

HTTP 200 OK { "responses": { "per_page": 20, "total_pages": 1, "current_page": 1, "total_entries": 1, "responses": [ { "last_editor": null, "processed_body": "

Im praying too!

", "updated_at": "10/16/2012 11:19 PM (UTC)", "created_at": "10/16/2012 11:19 PM (UTC)", "blurb": "Im praying too!", "body": "

Im praying too!

", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "nickname": "", "id": 946060874 }, "id": 1069956082 } ] }, "not_respondable": false, "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 }, "member_only": false, "file_attachments": [], "last_editor": null, "group_id": 839047027, "title": "Updated my Title", "short_url": null, "gender_only": false, "gender_only_gender": null, "processed_body": "

Which are often the best

", "updated_at": "10/16/2012 11:19 PM (UTC)", "emergency": false, "shareable": true, "leader_only": false, "plaza": false, "created_at": "09/25/2012 07:03 PM (UTC)", "featured": false, "blurb": "Which are often the best", "body": "Which are often the best", "id": 292743653, "limit_email": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045524/markblair_thumb.png?1259810616", "last": "Leaderman", "title": null, "middle": "", "first": "John", "nickname": "", "id": 830138774 }, "shared_to_groups": [], "shared_to_users": [] }

Prayers Destroy

DELETE /prayers/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X DELETE https://api.onthecity.org/prayers/145570352

Required Permissions

Current user must have an active role in the group.

Current user must have permission to delete this prayer (group leader or prayer author).

Parameters

N/A

Return Data

HTTP 204

Topics Show

GET /topics/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X GET http://api.onthecity.org/topics/145570352/

Notes

Returns a topic, and one page of any responses to the topic.

Required Permissions

The current user must have an active role in the group where the topic was originally posted, or an active role in a group the topic was shared to, or the topic needs to be shared directly to the current user.

Parameters

page = [1,2,3,...] <-- for paging through responses
    

Return Data

HTTP 200 OK { "id": 145570352, "body": "

shared plaza topic from Ballard to Johns Community Group

", "processed_body": "

shared plaza topic from Ballard to Johns Community Group

", "blurb": "shared plaza topic from Ballard to Johns Community Group", "group_id": 823956377, "leader_only": false, "shareable": true, "plaza": "Public", "title": "Shared Topic", "featured": false, "not_respondable": false, "short_url": "http://local.onthecity.org:3000/plaza/topics?group_id=839047027", "limit_email": false, "emergency": false, "updated_at": "10/02/2012 05:05 AM (UTC)", "member_only": false, "created_at": "09/25/2012 07:03 PM (UTC)", "gender_only_gender": null, "gender_only": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "title": "Pastor", "last": "Shepherd", "nickname": "", "middle": "", "first": "Sam", "id": 946060874 }, "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Ballard", "id": 823956377 }, "shared_to_groups": [ { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 } ], "file_attachments": [ { "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity-dev/file_attachments/980190963/DSC_0433.jpg?Signature=t9%2FZiWFcVJPw%2FU3pHQMYLyXUPOY%3D&Expires=1349214393&AWSAccessKeyId=AKIAJUN5JWJJYXAMEYXA", "filename": "DSC_0433.jpg", "created_at": "10/02/2012 04:52 AM (UTC)", "content_type": "image/jpeg", "size": 322900, "id": 980190963 }, { "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity-dev/file_attachments/980190964/DSC_0357.jpg?Signature=AqoMb1jxrrsgljDbuYqByEVq%2BXw%3D&Expires=1349214393&AWSAccessKeyId=AKIAJUN5JWJJYXAMEYXA", "filename": "DSC_0357.jpg", "created_at": "10/02/2012 04:54 AM (UTC)", "content_type": "image/jpeg", "size": 262366, "id": 980190964 } ], "responses": { "per_page": 20, "total_entries": 4, "total_pages": 1, "current_page": 1, "responses": [ { "blurb": "Aloha", "": null, "updated_at": "10/01/2012 11:49 PM (UTC)", "created_at": "10/01/2012 11:49 PM (UTC)", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "nickname": "", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "id": 946060874 }, "id": 982569771, "file_attachments": [], "processed_body": "

Aloha

" }, { "blurb": "mm, hihasd sdsssdfsdsdf", "updated_at": "10/02/2012 03:33 AM (UTC)", "created_at": "10/01/2012 11:55 PM (UTC)", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "title": "Pastor", "last": "Shepherd", "nickname": "", "middle": "", "first": "Sam", "id": 946060874 }, "id": 982569772, "file_attachments": [], "processed_body": "

mm, hihasd sdsssdfsdsdf

" }, { "blurb": "Her is another", "": null, "updated_at": "10/02/2012 04:55 AM (UTC)", "created_at": "10/02/2012 04:55 AM (UTC)", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "title": "Pastor", "last": "Shepherd", "nickname": "", "middle": "", "first": "Sam", "id": 946060874 }, "id": 982569773, "file_attachments": [ { "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity-dev/file_attachments/980190965/DSC_0137.jpg?Signature=cOg38MlZ1rzCaMVzVi%2FHoX4K%2Fyk%3D&Expires=1349214393&AWSAccessKeyId=AKIAJUN5JWJJYXAMEYXA", "filename": "DSC_0137.jpg", "created_at": "10/02/2012 04:55 AM (UTC)", "content_type": "image/jpeg", "size": 330110, "id": 980190965 } ], "processed_body": "

Her is another

" }, { "blurb": "saaddasd", "": null, "updated_at": "10/02/2012 05:05 AM (UTC)", "created_at": "10/02/2012 05:05 AM (UTC)", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "title": "Pastor", "last": "Shepherd", "nickname": "", "middle": "", "first": "Sam", "id": 946060874 }, "id": 982569774, "file_attachments": [], "processed_body": "

saaddasd

" } ] } }

Topics Update

PUT /topics/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X PUT https://api.onthecity.org/topics/234234 -d "title=My Oh My!!!!!!!"

Required Permissions

User must have an active role in the group.

User must have permission to edit the topic (group leader or topic author).

Parameters

body = ["The body text of the status update"]

title = ["Topic title"]

Return Data

HTTP 200 OK { "id": 145570352, "body": "

shared plaza topic from Ballard to Johns Community Group

", "processed_body": "

shared plaza topic from Ballard to Johns Community Group

", "blurb": "shared plaza topic from Ballard to Johns Community Group", "group_id": 823956377, "leader_only": false, "shareable": true, "plaza": "Public", "title": "Shared Topic", "featured": false, "not_respondable": false, "short_url": "http://local.onthecity.org:3000/plaza/topics?group_id=839047027", "limit_email": false, "emergency": false, "updated_at": "10/02/2012 05:05 AM (UTC)", "member_only": false, "created_at": "09/25/2012 07:03 PM (UTC)", "gender_only_gender": null, "gender_only": false, "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "title": "Pastor", "last": "Shepherd", "nickname": "", "middle": "", "first": "Sam", "id": 946060874 }, "group": { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Ballard", "id": 823956377 }, "shared_to_groups": [ { "profile_pic": "https://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Johns Community Group", "id": 839047027 } ], "file_attachments": [ { "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity-dev/file_attachments/980190963/DSC_0433.jpg?Signature=t9%2FZiWFcVJPw%2FU3pHQMYLyXUPOY%3D&Expires=1349214393&AWSAccessKeyId=AKIAJUN5JWJJYXAMEYXA", "filename": "DSC_0433.jpg", "created_at": "10/02/2012 04:52 AM (UTC)", "content_type": "image/jpeg", "size": 322900, "id": 980190963 }, { "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity-dev/file_attachments/980190964/DSC_0357.jpg?Signature=AqoMb1jxrrsgljDbuYqByEVq%2BXw%3D&Expires=1349214393&AWSAccessKeyId=AKIAJUN5JWJJYXAMEYXA", "filename": "DSC_0357.jpg", "created_at": "10/02/2012 04:54 AM (UTC)", "content_type": "image/jpeg", "size": 262366, "id": 980190964 } ], "responses": { "per_page": 20, "total_entries": 4, "total_pages": 1, "current_page": 1, "responses": [ { "blurb": "Aloha", "": null, "updated_at": "10/01/2012 11:49 PM (UTC)", "created_at": "10/01/2012 11:49 PM (UTC)", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "nickname": "", "last": "Shepherd", "title": "Pastor", "middle": "", "first": "Sam", "id": 946060874 }, "id": 982569771, "file_attachments": [], "processed_body": "

Aloha

" }, { "blurb": "mm, hihasd sdsssdfsdsdf", "updated_at": "10/02/2012 03:33 AM (UTC)", "created_at": "10/01/2012 11:55 PM (UTC)", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "title": "Pastor", "last": "Shepherd", "nickname": "", "middle": "", "first": "Sam", "id": 946060874 }, "id": 982569772, "file_attachments": [], "processed_body": "

mm, hihasd sdsssdfsdsdf

" }, { "blurb": "Her is another", "": null, "updated_at": "10/02/2012 04:55 AM (UTC)", "created_at": "10/02/2012 04:55 AM (UTC)", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "title": "Pastor", "last": "Shepherd", "nickname": "", "middle": "", "first": "Sam", "id": 946060874 }, "id": 982569773, "file_attachments": [ { "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity-dev/file_attachments/980190965/DSC_0137.jpg?Signature=cOg38MlZ1rzCaMVzVi%2FHoX4K%2Fyk%3D&Expires=1349214393&AWSAccessKeyId=AKIAJUN5JWJJYXAMEYXA", "filename": "DSC_0137.jpg", "created_at": "10/02/2012 04:55 AM (UTC)", "content_type": "image/jpeg", "size": 330110, "id": 980190965 } ], "processed_body": "

Her is another

" }, { "blurb": "saaddasd", "": null, "updated_at": "10/02/2012 05:05 AM (UTC)", "created_at": "10/02/2012 05:05 AM (UTC)", "user": { "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "title": "Pastor", "last": "Shepherd", "nickname": "", "middle": "", "first": "Sam", "id": 946060874 }, "id": 982569774, "file_attachments": [], "processed_body": "

saaddasd

" } ] } }

Topics Destroy

DELETE /topics/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:7089dd67..." -X DELETE https://api.onthecity.org/topics/145570352

Required Permissions

Current user must have an active role in the group.

Current user must have permission to delete this topic (group leader or topic author).

Parameters

N/A

Return Data

HTTP 204