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"}

Groups | Albums Create

POST /groups/:group_id/albums/

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/823956377/albums -d "title=Baptisms"

Required Permissions

User must have an active role in the group.

User must have permission to create albums in the group.

Parameters

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

* title = ["Album title"]

leader_only = [ true | false ]

member_only = [ true | false ]

gender_only = [ true | false ]

limit_email = [ true | false ]

plaza = ['Private' | 'Public' ]

emergency = [ true | false ]

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": { "type":"Campus", "profile_pic": "http://local.devthecity.org:3000/images/default_group_large.jpg", "name":"Ballard", "id":823956377, "profile_picture":"http://local.devthecity.org:3000/images/default_group_large.jpg" }, "following":false, "last_editor":null, "disable_notifications":false, "address":null, "gender_only":false, "followers":[], "totally_public":false, "gender_only_gender":null, "shareable":false, "emergency":false, "updated_at":"03/17/2015 11:22 PM (UTC)", "plaza":false, "title":"Baptisms", "body":null, "blurb":null, "member_only":false, "short_url":null, "limit_email":false, "not_respondable":false, "prevent_additions":false, "leader_only":false, "featured":false, "created_at_epoch":1426634533, "user": { "facebook_id":null, "last":"Smith", "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "gender":"Male", "first":"Steve", "name":"Pastor Steve Smith", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "group_id":823956377, "no_reply_show_responses":false, "id":978787830, "like_id":null, "updated_at_epoch":1426634533, "created_at":"03/17/2015 11:22 PM (UTC)", "like_count":0, "shared_to_users":[], "shared_to_groups":[], "processed_body":null } HTTP 400 {"error_code":400,"error_message":"Title can't be blank"}

Groups | Pending Albums Create

POST /groups/:group_id/pending_albums/

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/823956377/pending_albums -d ‘{“title”:”Easter”, "photos”: [{ “content_type”:”image/jpeg”, “size”:”10000”, “filename”:”setup.jpg”, “puid”:”8344df17c59c429c93f5004ae14d7c52", "make_album_cover": true }] }'

Required Permissions

User must have an active role in the group.

User must have permission to create pending albums in the group.

Parameters

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

* title = ["Pending Album title"]

leader_only = [ true | false ]

member_only = [ true | false ]

gender_only = [ true | false ]

limit_email = [ true | false ]

plaza = ['Private' | 'Public' ]

emergency = [ true | false ]

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":{ "type":"Campus", "profile_pic":"http://local.devthecity.org:3000/images/default_group_large.jpg", "name":"Ballard", "profile_picture":"http://local.devthecity.org:3000/images/default_group_large.jpg", "id":823956377 }, "following":false, "updated_at_epoch":1428019600, "not_respondable":false, "last_editor":null, "like_count":0, "photos":[{ "puid":"8344df17c59c429c93f5004ae14d7c52", "upload_form":{ "policy":"XXXXXXXXXXXXXXXXXXXXXXX", "success_action_status":"201", "AWSAccessKeyId":"XXXXXXXXXXXXXXXXXXXXXX", "signature":"XXXXXXXXXXXXXXXXXXXXXX", "Content-Type":"image/jpeg", "key":"photos/980190965/setup.jpg", "acl":"private"}, "upload_url":"https://thecity-dev.s3.amazonaws.com/", "filename":"setup.jpg", "album_id":978787831, "content_type":"image/jpeg", "size":10000, "id":980190965}], "address":null, "shareable":false, "featured":false, "followers":[], "disable_notifications":false, "member_only":false, "updated_at":"04/03/2015 12:06 AM (UTC)", "title":"Easter", "body":"", "emergency":false, "short_url":null, "plaza":false, "totally_public":false, "leader_only":false, "like_id":null, "gender_only":false, "limit_email":false, "prevent_additions":false, "user":{ "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Smith", "facebook_id":null, "gender":"Male", "first":"Foobar", "name":"Pastor Foobar Smith", "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "id":946060874}, "blurb":null, "group_id":823956377, "id":978787831, "gender_only_gender":null, "created_at_epoch":1428019600, "created_at":"04/03/2015 12:06 AM (UTC)", "shared_to_users":[], "shared_to_groups":[], "no_reply_show_responses":false, "processed_body":null } HTTP 400 {"error_code":400,"error_message":"Title 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

Albums Show

GET /albums/: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/albums/921586696/

Notes

Returns an album

Required Permissions

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

Parameters


    

Return Data

HTTP 200 OK { "group": { "profile_picture": "http://local.devthecity.org:3000/images/default_group_large.jpg", "type": "Campus", "profile_pic": "http://local.devthecity.org:3000/images/default_group_large.jpg", "name":"Ballard","id":823956377}, "address":null, "blurb":"dfg", "featured":false, "created_at_epoch":1423767629, "no_reply_show_responses":false, "not_respondable":false, "like_id":null, "last_editor":null, "created_at":"02/12/2015 07:00 PM (UTC)", "following":false, "body":"

dfg

", "gender_only":false, "updated_at_epoch":1423767629, "followers":[], "member_only":false, "like_count":0, "disable_notifications":false, "gender_only_gender":null, "shareable":false, "group_id":823956377, "leader_only":false, "totally_public":false, "updated_at":"02/12/2015 07:00 PM (UTC)", "plaza":false, "processed_body":"

dfg

", "prevent_additions":false, "user": { "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "gender":"Male", "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "first":"Sam", "name":"Pastor Sam Shepherd", "id":946060874, "facebook_id":null }, "title":"gfd", "short_url":null, "id":921586696, "emergency":false, "shared_to_users":[], "shared_to_groups":[], "limit_email":false, "photos_count":3, "album_cover":"http://s3.amazonaws.com:80/thecity-dev/photos/980190963/1_thumb.jpg?Signature=ShQEE9WHGau2yfvBex7N59I5ekU%3D&Expires=1429120525&AWSAccessKeyId=AKIAJUN5JWJJYXAMEYXA" }

Albums Update

PUT /albums/: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/albums/921586696 -d "body=Such Picture, Much Photo, Wow"

Required Permissions

User must have an active role in the group.

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

Parameters

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

title = ["Album title"]

Return Data

HTTP 200 OK { "group": { "profile_picture": "http://local.devthecity.org:3000/images/default_group_large.jpg", "type": "Campus", "profile_pic": "http://local.devthecity.org:3000/images/default_group_large.jpg", "name": "Ballard", "id": 823956377 }, "address": null, "blurb": "Such Picture, Much Photo, Wow", "featured": false, "created_at_epoch": 1423767629, "no_reply_show_responses": false, "not_respondable": false, "last_editor": { "profile_picture": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "gender":"Male", "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "first": "Sam", "name": "Pastor Sam Shepherd", "id": 946060874, "facebook_id": null }, "created_at": "02/12/2015 07:00 PM (UTC)", "like_id": null, "body": "Such Picture, Much Photo, Wow", "gender_only": false, "updated_at_epoch": 1423870008, "followers": [], "following": false, "member_only": false, "like_count": 0, "gender_only_gender": null, "shareable": false, "group_id": 823956377, "disable_notifications": false, "leader_only": false, "updated_at": "02/13/2015 11:26 PM (UTC)", "plaza": false, "processed_body": "

Such Picture, Much Photo, Wow

", "totally_public": false, "user": { "profile_picture": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last": "Shepherd", "gender": "Male", "thumbnail": "http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "first": "Sam", "name": "Pastor Sam Shepherd", "id":946060874, "facebook_id":null }, "title": "gfd", "short_url": null, "id": 921586696, "prevent_additions": false, "emergency": false, "shared_to_users": [], "shared_to_groups": [], "limit_email":false }

Albums Destroy

DELETE /albums/: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/albums/921586696

Required Permissions

Current user must have an active role in the group.

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

Parameters

N/A

Return Data

HTTP 204

Albums | Photos Index

GET /groups/:group_id/photos

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/albums/978787829/photos

Required Permissions

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

Parameters

page = [1, 2, ...]
    

Return Data

HTTP 200 OK { "total_entries": 1, "current_page": 1, "total_pages": 1, "per_page": 20, "photos": [{ "group":{ "type":"Campus", "profile_pic":"http://local.devthecity.org:3000/images/default_group_large.jpg", "name":"Ballard", "id":823956377, "profile_picture":"http://local.devthecity.org:3000/images/default_group_large.jpg" }, "puid":"490f468d558146bb8978c9ad4c218a9f", "not_respondable":false, "limit_email":false, "like_count":null, "last_editor":{ "last":"Smith", "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "gender":"Male", "facebook_id":null, "first":"Foobar", "name":"Pastor Foobar Smith", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "height":null, "featured":false, "shareable":false, "address":null, "filename":"best_photo_ever.jpg", "fullsize_image":null, "thumbnail":null, "created_at_epoch":1428017971, "updated_at":"04/02/2015 11:42 PM (UTC)", "member_only":false, "content_type":"image/jpeg", "album_id":978787829, "updated_at_epoch":1428018131, "emergency":false, "body":"", "title":"", "leader_only":false, "size":10000, "gender_only":false, "id":980190964, "group_id":"", "blurb":"", "user":{ "last":"Smith", "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "gender":"Male", "facebook_id":null, "first":"Foobar", "name":"Pastor Foobar Smith", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "width":null, "processed_body":"", "no_reply_show_responses":false, "shared_to_groups":[], "shared_to_users":[], "created_at":"04/02/2015 11:39 PM (UTC)", "gender_only_gender":null, "position":2 }] }

Albums | Photos Create

GET /photos/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:local" -H "X-CITY-ACCESS-TOKEN:96095fbd55bd04b0277e68aaa2832cff1e5e1c3b81501ca228e5577fb133f7d3" -X POST https://api.onthecity.org/albums/978787829/photos -d "caption=Best Photo Ever" -d "size=10000" -d "content_type=image/jpeg" -d "filename=best_photo_ever.jpg" -d "puid=490f468d558146bb8978c9ad4c218a9f"

Required Permissions

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

Parameters

make_album_cover = [ true | false ]
    

Return Data

HTTP 200 OK { "group":{ "type":"Campus", "profile_pic":"http://local.devthecity.org:3000/images/default_group_large.jpg", "name":"Ballard", "id":823956377, "profile_picture":"http://local.devthecity.org:3000/images/default_group_large.jpg" }, "puid":"490f468d558146bb8978c9ad4c218a9f", "upload_form":{ "policy":"XXXXXXXXXXXXXXXXXXXX", "success_action_status":"201", "AWSAccessKeyId":"XXXXXXXXXXXXXXXXXX", "signature":"XXXXXXXXXXXXXXXXXXX", "Content-Type":"image/jpeg", "key":"photos/980190964/best_photo_ever.jpg", "acl":"private"}, "upload_url":"https://thecity-dev.s3.amazonaws.com/", "not_respondable":false, "last_editor":null, "like_count":null, "limit_email":false, "height":null, "address":null, "shareable":false, "featured":false, "filename":"best_photo_ever.jpg", "fullsize_image":null, "thumbnail":null, "created_at_epoch":1428017971, "member_only":false, "updated_at":"04/02/2015 11:39 PM (UTC)", "content_type":"image/jpeg", "album_id":978787829,"title":"", "body":"", "emergency":false, "updated_at_epoch":1428017971, "leader_only":false, "size":10000, "gender_only":false, "user":{ "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Smith", "facebook_id":null, "gender":"Male", "first":"Foobar", "name":"Pastor Foobar Smith", "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "id":946060874}, "blurb":"", "group_id":"", "id":980190964, "width":null, "gender_only_gender":null, "created_at":"04/02/2015 11:39 PM (UTC)", "shared_to_users":[], "shared_to_groups":[], "no_reply_show_responses":false, "processed_body":"", "position":null }

Albums | Responses Index

GET /albums/:album_id/responses

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/albums/921586696/responses

Notes

Returns responses to an album

Required Permissions

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

Parameters


    

Return Data

HTTP 200 OK { "total_entries": 1, "current_page": 1, "total_pages": 1, "per_page": 20, "responses": [{ "is_an_update":false, "last_editor":null, "blurb":"This is a great collection of baptism pictures!", "processed_body":"

This is a great collection of baptism pictures!

", "created_at_epoch":1426694559, "updated_at":"03/18/2015 04:02 PM (UTC)", "updated_at_epoch":1426694559, "body":"This is a great collection of baptism pictures!", "user": { "facebook_id":null, "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Smith", "gender":"Male", "first":"Steve", "name":"Pastor Steve Smith", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616"}, "id":930904967, "created_at":"03/18/2015 04:02 PM (UTC)" } }] }

Albums | Responses Show

GET /albums/:album_id/responses/:id

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/albums/934453034/responses/1

Notes

Returns a specific response for an album.

Required Permissions

Current user must have an active role in the group that the album was posted in, the album must be shared to a group that the current user is in, or the album must be directly shared to the current user.

Current user must pass view restrictions for the album (gender-ony, member-only, leader-only).

Parameters

N/A

Return Data

HTTP 200 OK { "processed_body":"

I love these pictures!

", "blurb":"I love these pictures!", "last_editor":null, "updated_at":"03/18/2015 06:44 PM (UTC)", "body":"I love these pictures!", "created_at_epoch":1426704287, "updated_at_epoch":1426704287, "is_an_update":false, "id":930904967, "user": { "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "facebook_id":null, "gender":"Male", "first":"Sam", "name":"Pastor Sam Shepherd", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "created_at":"03/18/2015 06:44 PM (UTC)" }

Albums | Responses Create

POST /albums/:album_id/responses/

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/albums/839047027/responses -d "body=I love these pictures!"

Required Permissions

Current user must have an active role in the group that the album was posted in, or the album must be shared to a group that the current user is in, or the album must be directly shared to the current user.

Current user must pass view restrictions for the album (gender-ony, member-only, leader-only).

Parameters

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

Return Data

HTTP 200 OK { "is_an_update":false, "last_editor":null, "blurb":"I love these pictures!", "processed_body":"

I love these pictures!

", "created_at_epoch":1426697852, "updated_at":"03/18/2015 04:57 PM (UTC)", "updated_at_epoch":1426697852, "body":"I love these pictures!", "user": { "facebook_id":null, "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Smith", "gender":"Male", "first":"Steve", "name":"Pastor Steve Smith", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "id":930904968, "created_at":"03/18/2015 04:57 PM (UTC)" }

Albums | Responses Update

PUT /albums/:album_id/responses/: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/albums/934453034/responses/1?body=nice

notes

updates the body text of a specific response :id, which belongs to the discussion thread for an album.

required Permissions

current user must have an active role in the group that the album was posted in, or the album must be shared to a group that the current user is in, or the album must be directly shared to the current user.

current user must pass view restrictions for the album (gender-ony, member-only, leader-only).

current user must either be a group leader in the original group the album was posted in, the author of the album, or the author of the response.

parameters

* body = ["The updated body text of the response"]

return Data

http 200 OK { "created_at_epoch":1426704287, "processed_body":"

nice

", "last_editor": { "facebook_id":null, "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "gender":"Male", "first":"Sam", "name":"Pastor Sam Shepherd", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "updated_at_epoch":1426706688, "is_an_update":false, "updated_at":"03/18/2015 07:24 PM (UTC)", "body":"nice", "user": { "facebook_id":null, "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "gender":"Male", "first":"Sam", "name":"Pastor Sam Shepherd", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "id":930904967, "blurb":"nice", "created_at":"03/18/2015 06:44 PM (UTC)" }

Albums | Responses Destroy

DELETE /albums/:album_id/responses/: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/albums/934453034/responses/1056227698

Required Permissions

Current user must have an active role in the group that the album was posted in, the album must be shared to a group that the current user is in, or the album must be directly shared to the current user.

Current user must pass view restrictions for the album (gender-ony, member-only, leader-only).

Current user must either be a group leader in the original group that the album was posted in, the author of the album, or the author of the response.

Parameters

N/A

Return Data

HTTP 204 RESPONSE SUCCESSFULLY DESTROYED

Photos Show

GET /photos/: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/photos/980190964/

Notes

Returns a photo.

Required Permissions

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

Parameters

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

Return Data

HTTP 200 OK { "puid":"490f468d558146bb8978c9ad4c218a9f", "group":{ "type":"Campus", "profile_pic":"http://local.devthecity.org:3000/images/default_group_large.jpg", "name":"Ballard", "id":823956377, "profile_picture":"http://local.devthecity.org:3000/images/default_group_large.jpg" }, "not_respondable":false, "height":null, "last_editor":{ "last":"Smith", "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "gender":"Male", "facebook_id":null, "first":"Foobar", "name":"Pastor Foobar Smith", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "like_count":null, "limit_email":false, "fullsize_image":null, "thumbnail":null, "filename":"best_photo_ever.jpg", "address":null, "shareable":false, "featured":false, "created_at_epoch":1428017971, "album_id":978787829, "content_type":"image/jpeg", "member_only":false, "updated_at":"04/02/2015 11:42 PM (UTC)", "title":"", "body":"", "emergency":false, "updated_at_epoch":1428018131, "size":10000, "leader_only":false, "gender_only":false, "width":null, "user":{ "last":"Smith", "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "gender":"Male", "facebook_id":null, "first":"Foobar", "name":"Pastor Foobar Smith", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "blurb":"", "group_id":"", "id":980190964, "position":2, "gender_only_gender":null, "created_at":"04/02/2015 11:39 PM (UTC)", "shared_to_users":[], "shared_to_groups":[], "no_reply_show_responses":false, "processed_body":"" }

Photos Update

PUT /photos/:id

Example

curl -H "Accept: application/vnd.thecity.v1+json" -H "X-CITY-SUBDOMAIN:church" -H "X-CITY-ACCESS-TOKEN:96095fbd55bd04b0277e68aaa2832cff1e5e1c3b81501ca228e5577fb133f7d3" -X PUT https://api.onthecity.org/photos/980190964 -d “position=2"

Required Permissions

User must have an active role in the group.

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

Parameters

make_album_cover = [ true | false ]

  

Return Data

HTTP 200 OK { "group":{ "type":"Campus", "profile_pic":"http://local.devthecity.org:3000/images/default_group_large.jpg", "name":"Ballard", "profile_picture":"http://local.devthecity.org:3000/images/default_group_large.jpg", "id":823956377 }, "puid":"490f468d558146bb8978c9ad4c218a9f", "not_respondable":false, "last_editor":{ "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Smith", "facebook_id":null, "gender":"Male", "first":"Foobar", "name":"Pastor Foobar Smith", "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "id":946060874}, "like_count":null, "limit_email":false, "height":null, "address":null, "shareable":false, "featured":false, "filename":"best_photo_ever.jpg", "fullsize_image":null, "thumbnail":null, "created_at_epoch":1428017971, "member_only":false, "updated_at":"04/02/2015 11:42 PM (UTC)", "content_type":"image/jpeg", "album_id":978787829," title":"", "body":"", "emergency":false, "updated_at_epoch":1428018131, "leader_only":false, "size":10000, "gender_only":false, "user":{ "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Smith", "facebook_id":null, "gender":"Male", "first":"Foobar", "name":"Pastor Foobar Smith", "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "id":946060874 }, "blurb":"", "group_id":"", "id":980190964, "width":null, "gender_only_gender":null, "created_at":"04/02/2015 11:39 PM (UTC)", "shared_to_users":[], "shared_to_groups":[], "no_reply_show_responses":false, "processed_body":"", "position":2 }

Photos Destroy

DELETE /photos/: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/photos/921586696

Required Permissions

Current user must have an active role in the group.

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

Parameters

N/A

Return Data

HTTP 204

Pending Albums Show

GET /pending_albums/: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/pending_albums/921586696/

Notes

Returns an pending_album

Required Permissions

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

Parameters


    

Return Data

HTTP 200 OK { "following":false, "like_count":0, "group":{ "type":"Campus", "profile_pic":"http://local.devthecity.org:3000/images/default_group_large.jpg", "name":"Ballard", "id":823956377, "profile_picture":"http://local.devthecity.org:3000/images/default_group_large.jpg" }, "processed_body":null, "prevent_additions":false, "last_editor":null, "like_id":null, "disable_notifications":false, "followers":[], "gender_only":false, "address":null, "limit_email":false, "updated_at":"03/19/2015 03:39 PM (UTC)", "shareable":false, "gender_only_gender":null, "totally_public":false, "plaza":false, "short_url":null, "created_at_epoch":1426779582, "member_only":false, "body":"", "title":"Easter", "updated_at_epoch":1426779582, "emergency":false, "leader_only":false, "id":978787830, "group_id":823956377, "blurb":null, "user":{ "last":"Shepherd", "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "gender":"Male", "first":"Sam", "facebook_id":null, "name":"Pastor Sam Shepherd", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "not_respondable":false, "no_reply_show_responses":false, "shared_to_groups":[], "shared_to_users":[], "created_at":"03/19/2015 03:39 PM (UTC)", "featured":false, "photos_count":3, "album_cover":"http://s3.amazonaws.com:80/thecity-dev/photos/980190963/1_thumb.jpg?Signature=ShQEE9WHGau2yfvBex7N59I5ekU%3D&Expires=1429120525&AWSAccessKeyId=AKIAJUN5JWJJYXAMEYXA" }

Pending Albums Update

PUT /pending_albums/: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/pending_albums/921586696 -d "title=Easter Album"

Required Permissions

User must have an active role in the group.

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

Parameters

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

title = ["Pending Album title"]

complete = true <-- for converting pending album to album

Return Data

HTTP 200 OK { "group":{ "type":"Campus", "profile_pic":"http://local.devthecity.org:3000/images/default_group_large.jpg", "name":"Ballard", "id":823956377, "profile_picture":"http://local.devthecity.org:3000/images/default_group_large.jpg" }, "like_count":0, "following":false, "processed_body":null, "last_editor":null, "prevent_additions":false, "address":null, "gender_only":false, "followers":[], "disable_notifications":false, "like_id":null, "limit_email":false, "gender_only_gender":null, "shareable":false, "updated_at":"03/19/2015 04:07 PM (UTC)", "title":"Easter Album", "body":"", "member_only":false, "created_at_epoch":1426779582, "short_url":null, "plaza":false, "totally_public":false, "leader_only":false, "emergency":false, "updated_at_epoch":1426781271, "user":{ "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "gender":"Male", "first":"Sam", "name":"Pastor Sam Shepherd", "facebook_id":null, "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "blurb":null, "group_id":823956377, "id":978787830, "featured":false, "created_at":"03/19/2015 03:39 PM (UTC)", "shared_to_users":[], "shared_to_groups":[], "no_reply_show_responses":false, "not_respondable":false }

Pending Albums Destroy

DELETE /pending_albums/: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/pending_albums/921586696

Required Permissions

Current user must have an active role in the group.

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

Parameters

N/A

Return Data

HTTP 204

Photos | Responses Index

GET /photos/:photo_id/responses

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/photos/921586696/responses

Notes

Returns responses to a photo

Required Permissions

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

Parameters


    

Return Data

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

I love this picture!

", "last_editor":null, "updated_at_epoch":1426720354, "is_an_update":false, "updated_at":"03/18/2015 11:12 PM (UTC)", "body":"I love this picture!", "user":{ "facebook_id":null, "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "gender":"Male", "first":"Sam", "name":"Pastor Sam Shepherd", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616"}, "id":980190963, "blurb":"I love this picture!", "created_at":"03/18/2015 11:12 PM (UTC)" }] }

Photos | Responses Show

GET /photos/:photo_id/responses/:id

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/photos/934453034/responses/1

Notes

Returns a specific response for an photo.

Required Permissions

Current user must have an active role in the group that the photo was posted in, the photo must be shared to a group that the current user is in, or the photo must be directly shared to the current user.

Current user must pass view restrictions for the photo (gender-ony, member-only, leader-only).

Parameters

Return Data

HTTP 200 OK { "processed_body":"

I love this picture!

", "created_at_epoch":1426720354, "last_editor":null, "updated_at_epoch":1426720354, "updated_at":"03/18/2015 11:12 PM (UTC)", "is_an_update":false, "body":"I love this picture!", "blurb":"I love this picture!", "id":980190963, "user":{ "facebook_id":null, "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "gender":"Male", "first":"Sam", "name":"Pastor Sam Shepherd", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "created_at":"03/18/2015 11:12 PM (UTC)" }

Photos | Responses Create

POST /photos/:photo_id/responses/

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/photos/839047027/responses -d "body=I love this picture!"

Required Permissions

Current user must have an active role in the group that the album was posted in, the album must be shared to a group that the current user is in, or the album must be directly shared to the current user.

Current user must pass view restrictions for the photo(gender-ony, member-only, leader-only).

Parameters

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

Return Data

HTTP 200 OK { "created_at_epoch":1426720354, "processed_body":"

I love this picture!

", "last_editor":null, "updated_at_epoch":1426720354, "is_an_update":false, "updated_at":"03/18/2015 11:12 PM (UTC)", "body":"I love this picture!", "user":{ "facebook_id":null, "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "gender":"Male", "first":"Sam", "name":"Pastor Sam Shepherd", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616" }, "id":980190963, "blurb":"I love this picture!", "created_at":"03/18/2015 11:12 PM (UTC)" }

Photos | Responses Update

PUT /photos/:photo_id/responses/: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/photos/934453034/responses/1?body=nice

notes

updates the body text of a specific response :id, which belongs to the discussion thread for an photo.

required Permissions

current user must have an active role in the group that the photo was posted in, or the photo must be shared to a group that the current user is in, or the photo must be directly shared to the current user.

current user must pass view restrictions for the photo (gender-ony, member-only, leader-only).

current user must either be a group leader in the original group the photo was posted in, the author of the photo, or the author of the response.

parameters

* body = ["The updated body text of the response"]

return Data

http 200 OK { "created_at_epoch":1426720354, "processed_body":"

nice

", "last_editor":{ "facebook_id":null, "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "gender":"Male", "first":"Sam", "name":"Pastor Sam Shepherd", "id":946060874, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616"}, "updated_at_epoch":1426721645, "is_an_update":false, "updated_at":"03/18/2015 11:34 PM (UTC)", "body":"nice", "user":{ "facebook_id":null, "thumbnail":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616", "last":"Shepherd", "gender":"Male", "first":"Sam", "name":"Pastor Sam Shepherd", "id":94606087, "profile_picture":"http://d3q4ygrk6gvzb3.cloudfront.net/image_attachments/1030045521/zackhubert_thumb.png?1259810616"}, "id":980190963, "blurb":"nice", "created_at":"03/18/2015 11:12 PM (UTC)" }

Photos | Responses Destroy

DELETE /photos/:photo_id/responses/: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/photos/934453034/responses/1056227698

Required Permissions

Current user must have an active role in the group that the photo was posted in, the photo must be shared to a group that the current user is in, or the photo must be directly shared to the current user.

Current user must pass view restrictions for the photo (gender-ony, member-only, leader-only).

Current user must either be a group leader in the original group that the photo was posted in, the author of the photo, or the author of the response.

Parameters

Return Data

HTTP 204 RESPONSE SUCCESSFULLY DESTROYED