The City Admin API v.1.0

Introduction

The City Admin API provides developers with a REST-based interface to create applications and tools that require access to data that lives in or originated from The City. The intention is to provide programatic access to the same data and functionality you have via The City's Admin site on the web.

The types of tools and applications made possible by this API are numerous. Examples could by data sync tools with external databases or church management systems, custom reporting and dashboard applications, single or limited-purpose mobile apps for administrators and leadership, or specialized kiosks for assimilation or information.

Security & Authentication

The City Admin API utilizes a HMAC signature scheme for authentication. The client must send the HMAC signature together with a set of special HTTP headers when making a request. This ensures that the request is being made from an approved, known client, and that the request has not been tampered with. All requests must also be made over an SSL connection, which provides extra security during request transmission.

Keys & Tokens

To obtain the API key necessary to start using The City Admin API, you must first grant someone API Admin privileges. Go to Admin > Privileges > API Admin and grant an active City user API Admin privileges. This user is now able to create and assign new access keys to other users (or themselves).

To obtain a new key, as an API Admin, go to Admin > API > Keys. Click "+ Add New API Key", and associate a key with a user in your City. When you sign a request with this key, the request will carry with it any privileges that the user has (Group Admin, User Admin, Reporting Admin, etc.) so make sure you associate the key to a user with the appropriate level of access that your app will require.

Keys & Tokens

Secret Key - This is the key that you will use to sign your requests so that we know they came from you, and were not tampered with. Keep this safe (and secret)!

User Token - This is the key you will send along with your signed requests so that we know which secret key to use on our end to decode your signature.

A key will also change statuses based on certain actions:

  • Banned - If your key or account has been temporarily blocked because you exceeded an API rate limit.
  • Disabled - When you delete a key, it gets disabled and is no longer available for signing requests.

Signing Requests

The HMAC signature will consist of the following data:

  • The current Unix time in seconds
  • The HTTP verb of your request, e.g. "GET", "PUT", or "POST"
  • The host and path of your request, e.g "https://api.onthecity.org/admin/groups/ 1234"
  • Any query parameters, sorted alphabetically and canonicalized, e.g. "bar=foo&some_param=some_value&user_id=12345"
  • On a POST or PUT request with body data, the post body data

In pseudocode, your request data string to sign will be: time + verb + host + path + query_params + body. Once you have your request data ready to sign, there is a 3-step process:

  • First, concatenate a string of the data above, and then construct an HMAC signature using SHA-256 as the HMAC message digest algorithm.
  • Next, Base64 encode the HMAC output.
  • Lastly, URL-encode the Base64-encoded HMAC code

Examples of signing

Here is an example using the OpenSSL HMAC implementation in Ruby:

require 'openssl'
require 'CGI'

unix_time = Time.now.to_i
http_verb = "GET" #GET | PUT | POST | DELETE
string_to_sign = "#{unix_time}#{http_verb}https://api.onthecity.org/groups/1234?param1=some_value¶m2=12345"

secret_key = '1234567890...' #get this from The City API admin panel
unencoded_hmac = OpenSSL::HMAC.digest('sha256', secret_key, string_to_sign)
unescaped_hmac = Base64.encode64(hmac).chomp #chomp removes any new line or carriage return characters from the string end
hmac_signature = CGI.escape(unescaped_hmac)

Here is an example in C#

using System;
using System.IO;
using System.Security.Cryptography;

// Calculate current Unix time in seconds
var unixTime = (int)(DateTime.Now -­‐ new DateTime(1970, 1, 1).ToLocalTime()).TotalSeconds;

// Concatenate time + verb + host + path + query_params + body
var stringToSign = string.Format("{0}{1}{2}{3}", unixTime, httpVerb, fullAddress, body);

// Construct HMAC signature
var encoding = Encoding.UTF8;
var hmacSha256 = new HMACSHA256(encoding.GetBytes(secretKey));
var stream = new MemoryStream(encoding.GetBytes(stringToSign));
var unencodedHmac = hmacSha256.ComputeHash(stream);

// Base64 encode the HMAC output
var unescapedHmac = Convert.ToBase64String(unencodedHmac).TrimEnd();

//URL-encode the Base64-encoded HMAC code
var hmacSignature = Uri.EscapeDataString(unescapedHmac);

Required Headers

There are four required HTTP headers (six on a POST request) that must be present on every request to The City Admin API. A request that is missing any of these headers will be rejected and will receive a 4xx HTTP Status Code (400 Bad Request or 406 Not Acceptable).

The following headers are required, or else you will receive a 400 Bad Request:

  • X-City-Sig: The HMAC signature, Base64 and URL encoded.
  • X-City-User-Token: The User Token, a 16-digit hexadecimal key that is paired with your secret key used to craft your HMAC signature.
  • X-City-Time: The same Unix time in seconds you used in your signature.

You must also specify which version of the API/resource you are requesting by setting the accept header like this (or else you will receive a 406 Not Acceptable):

  • Accept: application/vnd.thecity.admin.v1+json

If you are sending a body, you must also set:

  • Content-Type: application/json
  • Content-Length: the length in bytes of your request body

Rate Limiting

The City Admin API is throttled and rate limited for all accounts. While the request limits are generous, you may receive a 403 Forbidden -- Rate Limit Exceeded HTTP Status Code if your client exceeds one of the limits.

In the response headers for any request to the API, you will receive two headers that will inform you of your current rate limit remaining.

  • X-City-RateLimit-Limit-By-Account
  • X-City-RateLimit-Remaining-By-Account

It is the responsibility of the client to maintain a back-off strategy in order to avoid being temporarily or permanently "blacklisted". Too many 403 responses will get your IP Address, or your access keys, disabled and/or your account's access to the API turned off.

API Endpoints

Users Index

GET /users

Example

https://api.onthecity.org/users?filter=created_in_the_last_10_days

Notes

If you pass include_participation=true, you will get more data returned to you, including:

  • last_checkin_date
  • last_donation_date
  • last_attendance_date
  • in_community
  • in_service
  • in_welcome
  • in_campus
  • in_neighborhood

The "in_group_type" field names will carry whatever your City has renamed those group types to.

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

filter = ["created_in_the_last_7_Days" | "created_in_the_last_N_PERIOD"]

filter = ["contact_updated_in_the_last_3_weeks" | "contact_updated_in_the_last_N_PERIOD"]

filter = ["with_external_id_1" | "with_external_id_2" | "with_external_id_3"]

filter = ["without_external_id_1" | "without_external_id_2" | "without_external_id_3"]

filter = ["created_between_YYYYMMDD_YYYYMMDD" | "updated_between_YYYYMMDD_YYYYMMDD"]

include_participation = [true]

include_custom_fields = [true]

Return Data

HTTP 200 OK { "total_entries": 703, "total_pages": 36, "per_page": 20, "current_page": 1, "users": [ { "admin_url": "http://church.onthecity.org/admin/users/946060874", "api_url": "https://api.onthecity.org/users/946060874", "internal_url": "http://church.onthecity.org/users/946060874", "updated_at": "05/15/2012 07:24 AM (UTC)", "last_logged_in": "05/16/2012 04:52 AM (UTC)", "secondary_phone": "", "last_engaged": "05/16/2012 04:52 AM (UTC)", "title": "Pastor", "internal_url": "http://church.onthecity.org/users/946060874", "id": 946060874, "first": "Sam", "primary_campus_name": null, "last": "Shepherd", "head_of_household": true, "nickname": "Sammy", "active": true, "primary_phone_type": "home", "primary_phone": "", "member_since": "05/14/2012", "birthdate": "1974-11-09", "email_bouncing": false, "secondary_phone_type": "home", "primary_campus_id": null, "contact_updated_at": "05/15/2012 12:24 AM (UTC)", "type": "User", "staff": true, "created_at": "05/14/2012 05:51 PM (UTC)", "gender": "Male", "External ID 3": null, "External ID 2": null, "External ID 1": null, "external_id_1": null, "external_id_2": null, "external_id_3": null, "external_chms_id": 8787, "middle": "", "email": "zack@church.org" }, { ... } ], }

Users | Show

GET /users/:id

Example

https://api.onthecity.org/users/452617

Notes

If you pass include_participation=true, you will get more data returned to you, including:

  • last_checkin_date
  • last_donation_date
  • last_attendance_date
  • in_community
  • in_service
  • in_welcome
  • in_campus
  • in_neighborhood

The "in_group_type" field names will carry whatever your City has renamed those group types to.

Required Permissions

User Admin

Parameters

include_participation = [true]

include_custom_fields = [true]

Return Data

HTTP 200 OK { "admin_url": "http://church.onthecity.org/admin/users/946060874", "api_url": "https://api.onthecity.org/users/946060874", "internal_url": "http://church.onthecity.org/users/946060874", "updated_at": "05/15/2012 07:24 AM (UTC)", "last_logged_in": "05/16/2012 04:52 AM (UTC)", "secondary_phone": "", "last_engaged": "05/16/2012 04:52 AM (UTC)", "title": "Pastor", "internal_url": "http://church.onthecity.org/users/946060874", "id": 946060874, "first": "Sam", "primary_campus_name": null, "last": "Shepherd", "head_of_household": true, "nickname": "Sammy", "active": true, "primary_phone_type": "home", "primary_phone": "", "member_since": "05/14/2012", "birthdate": "1974-11-09", "email_bouncing": false, "secondary_phone_type": "home", "primary_campus_id": null, "contact_updated_at": "05/15/2012 12:24 AM (UTC)", "type": "User", "staff": true, "created_at": "05/14/2012 05:51 PM (UTC)", "gender": "Male", "External ID 3": null, "External ID 2": null, "External ID 1": null, "external_id_1": null, "external_id_2": null, "external_id_3": null, "external_chms_id": 8787, "middle": "", "email": "zack@church.org" }

Users Create

POST /users

Example

https://api.onthecity.org/users?first=Mark&last=Flair&email=mark@flair.org

Required Permissions

User Admin

Parameters

title = ["Pastor" | "Deacon" | "..." ]

first = ["FirstName"]

middle = ["MiddleName"]

last = ["LastName"]

nickname = ["PreferedName"]

gender = ["Male", "Female"]

email = ["valid@email_address.com"] <- MUST BE UNIQUE

staff = [ true | false ]

primary_campus_id = [123456789]

member_since = [ "DD/MM/YYYY" | "YYYY-MM-DD" ]

birthdate = [ "DD/MM/YYYY" | "YYYY-MM-DD" ]

primary_phone = ["123-456-7890"]

primary_phone_type = ["Home" | "Work" | "Mobile" ]

secondary_phone = ["123-456-7890"]

secondary_phone_type = ["Home" | "Work" | "Mobile" ]

external_id_1 = ["UniqueString"] <- MUST BE UNIQUE

external_id_2 = ["String"]

external_id_3 = ["String"]

marital_status = ["Married", "Divorced", etc]

is_an_organization = [ true | false ]

CUSTOM_FIELD = ["String"]

† expects JSON body, query parameters, or x-www-form-urlencoded representation of a valid Offline User.

Return Data

HTTP 200 OK { "first": "Mark", "last": "Flair", ... (Same as User#Show) ... }

Users Update

PUT /users/:id

Example

https://api.onthecity.org/users/452617?title=Deacon&staff=true

Notes

When updating the email address of an online user, they will receive a "confirm this email address" notification that they must agree to before the change is complete.

Required Permissions

User Admin

Parameters

title = ["Pastor" | "Deacon" | "..." ]

first = ["FirstName"]

middle = ["MiddleName"]

last = ["LastName"]

nickname = ["PreferedName"]

gender = ["Male", "Female"]

email = ["valid@email_address.com"] <- MUST BE UNIQUE

staff = [ true | false ]

primary_campus_id = [123456789]

member_since = [ "DD/MM/YYYY" | "YYYY-MM-DD" ]

birthdate = [ "DD/MM/YYYY" | "YYYY-MM-DD" ]

primary_phone = ["123-456-7890"]

primary_phone_type = ["Home" | "Work" | "Mobile" ]

secondary_phone = ["123-456-7890"]

secondary_phone_type = ["Home" | "Work" | "Mobile" ]

external_id_1 = ["UniqueString"] <- MUST BE UNIQUE

external_id_2 = ["String"]

external_id_3 = ["String"]

marital_status = ["Married", "Divorced", etc]

is_an_organization = [ true | false ]

CUSTOM_FIELD = ["String"]

Return Data

HTTP 200 OK { "admin_url": "http://church.onthecity.org/admin/users/452617", "created_at": "01/15/2009 07:54 AM (CST)", "secondary_phone": "0987654321", "middle": "", ... (Same as User#Show) ... }

Users Destroy

DELETE /users/:id

Example

https://api.onthecity.org/users/452617

Notes

You can only destroy an offline user.

Required Permissions

User Admin

Parameters

N/A

Returned Data

HTTP 204 User Deleted Successfully

Users Count

GET /users/count

Example

https://api.onthecity.org/users/count?filter=created_in_the_last_78_days

Required Permissions

User Admin

Parameters

filter = ["created_in_the_last_7_Days" | "created_in_the_last_N_PERIOD"]

filter = ["contact_updated_in_the_last_3_weeks" | "contact_updated_in_the_last_N_PERIOD"]

filter = ["with_external_id_1" | "with_external_id_2" | "with_external_id_3"]

filter = ["without_external_id_1" | "without_external_id_2" | "without_external_id_3"]

Return Data

HTTP 200 OK { "count": 82, "filter": "created_in_the_last_78_days" }

Users | Memberize

PUT /users/:id/memberize

Example

https://api.onthecity.org/users/12345/memberize

Required Permissions

User Admin

Parameters

member_since = [ "DD/MM/YYYY" | "YYYY-MM-DD" ]

Return Data

{ "first": "Mark", "last": "Flair", ... (Same as User#Show) ... }

Users Dememberize

PUT /users/:id/dememberize

Example

https://api.onthecity.org/users/12345/dememberize

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "first": "Mark", "last": "Flair", ... (Same as User#Show) ... }

Users Deactivate

PUT /users/:id/deactivate

Example

https://api.onthecity.org/users/12345/deactivate?reason=Discipline!

Required Permissions

User Admin

Parameters

reason = ["String"]

Return Data

HTTP 200 OK { "first": "Mark", "last": "Flair", ... (Same as User#Show) ... }

Users Bulk Memberize

POST /users/bulk_memberize

Example

https://api.onthecity.org/users/bulk_memberize
  {
    "member_since":"4/26/2012",
    "members":[
      {"user_id":12345, "member_since":"1950-06-01"},
      {"email":"your@email.com"},
      {"external_id_1":"1234324234"}
    ]
  }

Notes

The "member_since" field is optional, and is used as a default if you do not specify a member_since date in the JSON block for each user. You have three options for looking up a user, by user_id, external_id_1, or email. One of these fields is required (see example below).

Required Permissions

User Admin

Parameters

member_since = ["2002-01-16"]

members = [{"user_id":12345},{"external_id_1":"1234AX23"},{"email":"me@work.biz"}]

Return Data

HTTP 204 NO CONTENT

Users Bulk Deactivate

POST /users/bulk_deactivate

Example

https://api.onthecity.org/users/bulk_deactivate

{"reason":"This is a default reason",
"users":[
  {"user_id":12345,
  "reason":"we don't like your kind"},
  {"email":"your@email.com"},
  {"external_id_1":"1234324234", "reason":"you stopped giving to the church"}
  ]
}

Notes

The "reason" field is optional, and is used as a default if you do not specify a reason in the JSON block for each user. You have three options for looking up a user, by user_id, external_id_1, or email. One of these fields is required (see example below).

Required Permissions

User Admin

Parameters

reason = ["String"]

users = [{"user_id":12345},{"external_id_1":"1234AX23"},{"email":"me@work.biz"}]

Return Data

HTTP 204 NO CONTENT

Users | Addresses Index

GET /users/:user_id/addresses

Example

https://api.onthecity.org/users/452617/addresses

Required Permissions

User Admin

Parameters

      page = [1, 2, ...]

      location_type = ["Home" | "Work"] <- defaults to all
    

Return Data

HTTP 200 OK { "total_entries": 2, "total_pages": 1, "addresses": [ { "city": null, "created_at": "05/01/2012 12:02 AM (UTC)", "latitude": null, "updated_at": "05/01/2012 12:02 AM (UTC)", "zipcode": null, "id": 1027473242, "street": "5555 Soth Way", "street2": null, "location_type": null, "privacy": "Private", "longitude": null, "state": null , "user_id": 452617, "user_external_id": 456282 },{ "city": "Sammamish", "created_at": "04/30/2012 11:54 PM (UTC)", "latitude": 47.60918, "updated_at": "05/01/2012 12:00 AM (UTC)", "zipcode": null, "id": 1027473241, "street": "12345 Main", "street2": "Apt 4", "location_type": null, "privacy": "Private", "longitude": -122.059499, "state": null, "user_id": 452617, "user_external_id": 456282 }], "per_page": 20, "current_page": 1 }

Users | Addresses Show

GET /users/:user_id/addresses/:id

Example

https://api.onthecity.org/users/452617/addresses/552561485

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "city": "Seattle", "created_at": "04/30/2012 08:46 PM (UTC)", "latitude": 47.64114, "updated_at": "04/30/2012 09:34 PM (UTC)", "zipcode": "98109", "id": 552561485, "street": "2547 32nd Ave W", "street2": null, "location_type": "Home", "privacy": "Private", "longitude": -122.398326, "state": "WA", "user_id": 452617, "user_external_id": 456282 }

Users | Addresses Create

POST /users/:user_id/addresses

Example

https://api.onthecity.org/users/452617/addresses

{"street":"24720 SE 31st Pl","city":"Issaquah"}

Required Permissions

User Admin

Parameters

street = ["1234 Main St"]

street2 = ["Apt 4"]

city = ["Seattle"]

state = ["WA"]

zipcode = ["98064"]

location_type = ["Home" | "Work" | "Mailing"]

Return Data

{ "city": "Issaquah", "created_at": "04/30/2012 11:54 PM (UTC)", "latitude": 47.60918, "updated_at": "05/01/2012 12:00 AM (UTC)", "zipcode": null, "id": 1027473241, "street": "24720 SE 31st Pl", "street2": "Apt 4", "location_type": null, "privacy": "Private", "longitude": -122.059499, "state": null, "user_id": 452617, "user_external_id": 456282 }

Users | Addresses Update

PUT /users/:user_id/addresses/:id

Example

https://api.onthecity.org/users/452617/addresses/552561485?state=WA

Required Permissions

User Admin

Parameters

street = ["1234 Main St"]

street2 = ["Apt 4"]

city = ["Seattle"]

state = ["WA"]

zipcode = ["98064"]

location_type = ["Home" | "Work" | "Mailing"]

Return Data

HTTP 200 OK { "city": null, created_at": "05/01/2012 12:02 AM (UTC)", "latitude": null, "updated_at": "05/01/2012 12:02 AM (UTC)", "zipcode": null, "id": 1027473242, "street": "5555 Soth Way", "location_type": null, "privacy": "Private", "longitude": null, "state": "WA", "user_id": 452617, "user_external_id": 456282 }

Users | Addresses Destroy

DELETE /users/:user_id/addresses/:id

Example

https://api.onthecity.org/users/452617/addresses/12345

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 204 Address Deleted Successfully

Users | Admin_Privileges Index

GET /users/:user_id/admin_privileges

Example

https://api.onthecity.org/users/452617/admin_privileges

Required Permissions

User Admin or Account Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 3, "total_pages": 1, "per_page": 20, "acct_roles": [ { "title": "Account Admin", "user_id": 452617, "user": "Dr. Third Eagle" },{ "title": "Financial User", "sub_role": "Admin User", "user_id": 452617, "user": "Dr. Third Eagle" },{ "title": "Group Admin", "sub_role": "Campus", "group_name": "Downtown", "group_id": 823956377, "user_id": 452617, "user": "Dr. Third Eagle" }], "current_page": 1 }

Users | Admin_Privileges Create

POST /users/:user_id/admin_privileges

Example

https://api.onthecity.org/users/452617/admin_privileges

{"title":"Designer"}

Required Permissions

Account Admin

Parameters

title = ["API Admin" | "Account Admin" | "Designer" | "Financial User" | "Group Admin" | "Process User" | "Reporting User" | "Resource Admin" | "Support Admin" | "User Admin"]

sub_title = ["Admin User" (default) | "Report User" | "Input User"] if title = "Financial User".

sub_title = ["Campus"] if title = "Group Admin". If you mean to create a Group Admin for the entire church, do not pass in a sub_title parameter.

If title = "Group Admin" and sub_title = "Campus", a campus_group parameter specifying the name of a valid campus group is required.

Return Data

HTTP 200 OK { "title": "Designer", "user_id": 452617, "user": "Dr. Third Eagle" }

Users | Barcodes Index

GET /users/:user_id/barcodes

Example

https://api.onthecity.org/users/452617/barcodes

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "current_page": 1, "barcodes": [ { "barcode": "2342hsdf23", "id": 1012338309, "created_at": "05/16/2012" },{ "barcode": "775757575775775", "id": 1012338304, "created_at": "05/16/2012" }], "total_pages": 1, "per_page": 20, "total_entries": 2 }

Users | Barcodes Show

GET /users/:user_id/barcodes/:id

Example

https://api.onthecity.org/users/452617/barcodes/234234234

Required Permissions

User Admin

Parameters

:id can be the barcode or the barcode's ID

Return Data

HTTP 200 OK { "barcode": "234234234", "id": 1012338309, "created_at": "05/16/2012" }

Users | Barcodes Create

POST /users/:user_id/barcodes

Example

https://api.onthecity.org/users/452617/barcodes?barcode=5812

Required Permissions

User Admin

Parameters

barcode = [12345 | "sdfhdf8d78d7f87" | etc]

Return Data

HTTP 200 OK { "barcode": "5812", "id": 1012338309, "created_at": "05/16/2012" }

Users | Barcodes Destroy

DELETE /users/:user_id/barcodes/:id

Example

https://api.onthecity.org/users/452617/barcodes/5812

Required Permissions

User Admin

Parameters

:id can be the barcode or the barcode's ID

Return Data

HTTP 204 Barcode Successfully Deleted

Users | Checkins Index

GET /users/:user_id/checkins

Example

https://api.onthecity.org/users/1234/checkins

Notes

Returns all the checkins that :user_id is either the check_in_user (kids) or the checked_in_by_user (parents).

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

include_checked_out = [ true | false ]

Return Data

HTTP 200 OK { "checkins": [ { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }, {...} ], "total_entries": 2, "total_pages": 1, "per_page": 20, "current_page": 1 }

Users | Checkins Show

GET /users/:user_id/checkins/:id

Example

https://api.onthecity.org/users/12345/checkins/3456

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }

Users | Checkins Last

GET /users/:user_id/checkins/last

Example

https://api.onthecity.org/users/12345/checkins/last

Notes

Returns the most recent checkin this user was either the parent (checked_in_by_user) or the child (checked_in_user)

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }

Users | Event Attendances Index

GET /users/:user_id/event_attendances

Example

https://api.onthecity.org/users/452617/event_attendances

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "event_attendances": [ { "group_name": "First Grade", "created_at": "07/29/2012", "event_title": "9 AM Service", "event_id": 84326420, "updated_at": "08/01/2012", "tracked_by": "Pastor Sam Shepherd", "id": 980190964, "group_id": 1023606148, "attended_on": "07/29/2012 04:00 PM (UTC)", "tracked_by_user_id": 946060874, "checkin_id": 235323 }, { "group_name": "Second Grade", "created_at": "07/29/2012", "event_title": "9 AM Service", "event_id": 161282077, "updated_at": "08/01/2012", "tracked_by": "Pastor Sam Shepherd", "id": 980190966, "group_id": 264535063, "attended_on": "07/29/2012 04:00 PM (UTC)", "tracked_by_user_id": 946060874, "checkin_id": null }, { "group_name": "Johns Community Group", "created_at": "08/01/2012", "event_title": "past event number 3", "event_id": 757552859, "updated_at": "08/01/2012", "tracked_by": "John Leaderman", "id": 980190976, "group_id": 839047027, "attended_on": "07/05/2012 04:00 PM (UTC)", "tracked_by_user_id": 830138774, "checkin_id": null } ], "current_page": 1, "total_entries": 3, "total_pages": 1, "per_page": 20, }

Users | Event Attendances Show

GET /users/:user_id/event_attendances/:id

Example

https://api.onthecity.org/users/452617/event_attendances/980190964

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group_name": "First Grade", "created_at": "07/29/2012", "event_title": "9 AM Service", "event_id": 84326420, "updated_at": "08/01/2012", "tracked_by": "Pastor Sam Shepherd", "id": 980190964, "group_id": 1023606148, "attended_on": "07/29/2012 04:00 PM (UTC)", "tracked_by_user_id": 946060874, "checkin_id": 235323 }

Users | Event Attendances Recent

GET /users/:user_id/event_attendances/recent

Example

https://api.onthecity.org/users/452617/event_attendances/recent

Notes

Returns the user's most recent event attendance.

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group_name": "First Grade", "created_at": "07/29/2012", "event_title": "9 AM Service", "event_id": 84326420, "updated_at": "08/01/2012", "tracked_by": "Pastor Sam Shepherd", "id": 980190964, "group_id": 1023606148, "attended_on": "07/29/2012 04:00 PM (UTC)", "tracked_by_user_id": 946060874, "checkin_id": 235323 }

Users | Event Attendances Dates

GET /users/:user_id/event_attendances/dates

Example

https://api.onthecity.org/users/452617/event_attendances/dates

Notes

Returns tan array of the unique dates this user has an event attendance on.

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK [ "2012-07-29", "2012-07-05" ]

Users | Invitations Index

GET /users/:user_id/invitations

Example

https://api.onthecity.org/users/452617/invitations

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 1, "total_pages": 1, "per_page": 20, "current_page": 1, "invitations": [ { "created_at": "02/06/2012", "pending_approval": false, "group_id": 17543, "id": 1696876, "user_id": 14347, "custom_message": null, "source": "API Invite | Group A (17543) on 2012-02-06 at 16:54", "email": "theusers@email.net", "title": "Participant", "name": null, "external_id_1": null, "external_id_2": null, "external_id_3": null, "member_since": null }, { ... } ] }

Users | Invitations Create

POST /users/:user_id/invitations

Example

https://api.onthecity.org/users/452617/invitations?group_id=5812&custom_message=Join!

Required Permissions

User Admin

Parameters

 group_id = [12345]

 group_external_id = ["12345"]

custom_message = ["Please join the group!"]

at least one of these is required

Return Data

{ "created_at": "02/06/2012", "pending_approval": false, "group_id": 5812, "id": 1696907, "user_id": 14347, "custom_message": "Join!", "source": "API Invite | Groupy Group (5812) on 2012-02-06 at 17:01", "email": "theusers@email.com", "title": "Participant", "name": null, "external_id_1": null, "external_id_2": null, "external_id_3": null, "member_since": null }

User | Family Index

GET /users/:user_id/family

Example

https://api.onthecity.org/users/12345/family

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "created_at": "04/30/2012 08:46 PM (UTC)", "external_id": "5555", "id": 398768686, "family_members": [ { "name": "Pastor Sam Shepherd", "admin_url": "http://church.onthecity.org/admin/users/946060874", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 946060874, "barcodes": [ { "created_at": "04/30/2012", "barcode": "0987654321" }], "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/946060874", "active": true, "email": "zack@onthecity.org" },{ "name": "Deacon Sally Shepherd", "admin_url": "http://church.onthecity.org/admin/users/23838500", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 23838500, "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/23838500", "active": true, "email": "deacon@onthecity.org" },{ "name": "Jack Hubert", "admin_url": "http://church.onthecity.org/admin/users/790725326", "External ID 1": null, "birthdate": "2006-11-09", "user_id": 790725326, "family_role": "Child", "api_url": "https://api.onthecity.org/users/790725326", "active": true, "email": null }] }

Users | Family Create

POST /users/:user_id/family

Example

https://api.onthecity.org/users/452617/family?family_id=5812&family_role=Spouse

Notes

Add this user to an existing family (by family_id or family_external_id).

Required Permissions

User Admin

Parameters

 family_id = [12345]

 family_external_id = [12345 | "234sdf34"]

family_role = ["Spouse" | "Other" | Child" | "TempChild" | "LegalChild"]

† either family_id or family_external_id required

Return Data

HTTP 200 OK { "created_at": "04/30/2012 08:46 PM (UTC)", "external_id": "5555", "id": 398768686, "family_members": [ { "name": "Pastor Sam Shepherd", "admin_url": "http://church.onthecity.org/admin/users/946060874", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 946060874, "barcodes": [ { "created_at": "04/30/2012", "barcode": "0987654321" }], "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/946060874", "active": true, "email": "zack@onthecity.org" },{ "name": "Deacon Sally Shepherd", "admin_url": "http://church.onthecity.org/admin/users/23838500", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 23838500, "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/23838500", "active": true, "email": "deacon@onthecity.org" },{ "name": "Jack Hubert", "admin_url": "http://church.onthecity.org/admin/users/790725326", "External ID 1": null, "birthdate": "2006-11-09", "user_id": 790725326, "family_role": "Child", "api_url": "https://api.onthecity.org/users/790725326", "active": true, "email": null }] }

Users | Family Update

PUT /users/:user_id/family

Example

https://api.onthecity.org/users/452617/family?family_role=Spouse

Notes

Update this users role in their family.

Required Permissions

User Admin

Parameters

family_role = ["Spouse" | "Other" | Child" | "TempChild" | "LegalChild"]

Return Data

HTTP 200 OK { "created_at": "04/30/2012 08:46 PM (UTC)", "external_id": "5555", "id": 398768686, "family_members": [ { "name": "Pastor Sam Shepherd", "admin_url": "http://church.onthecity.org/admin/users/946060874", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 946060874, "barcodes": [ { "created_at": "04/30/2012", "barcode": "0987654321" }], "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/946060874", "active": true, "email": "zack@onthecity.org" },{ "name": "Deacon Sally Shepherd", "admin_url": "http://church.onthecity.org/admin/users/23838500", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 23838500, "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/23838500", "active": true, "email": "deacon@onthecity.org" },{ "name": "Jack Hubert", "admin_url": "http://church.onthecity.org/admin/users/790725326", "External ID 1": null, "birthdate": "2006-11-09", "user_id": 790725326, "family_role": "Child", "api_url": "https://api.onthecity.org/users/790725326", "active": true, "email": null }] }

Users | Family Destroy

DELETE /users/:user_id/family

Example

https://api.onthecity.org/users/452617/family

Notes

Remove this user from his family (the other members will remain intact).

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 USER IS NO LONGER PART OF FAMILY

Users | Notes Index

GET /users/:user_id/notes

Example

https://api.onthecity.org/users/452617/notes

Required Permissions

User Admin.

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 3, "total_pages": 1, "notes": [ { "created_at": "05/08/2012", "author": "Pastor Sam Shepherd", "updated_at": "05/08/2012", "id": 756434909, "visible_to": [ "Account Admin" ], "author_id": 946060874 },{ "created_at": "05/08/2012", "author": "Pastor Sam Shepherd", "updated_at": "05/08/2012", "id": 756434908, "visible_to": [ "Account Admin" ], "author_id": 946060874 },{ "created_at": "05/08/2012", "author": "Pastor Sam Shepherd", "updated_at": "05/08/2012", "id": 756434907, "visible_to": [ "Account Admin", "User Admin" ], "author_id": 946060874 }], "per_page": 20, "current_page": 1 }

Users | Notes Show

GET /users/:user_id/notes/:id

Example

https://api.onthecity.org/users/452617/notes/121313

Required Permissions

User Admin or admin privilege listed in note's "visible_to" array.

Parameters

N/A

Return Data

HTTP 200 OK { created_at": "05/08/2012", "body": "Deaconship is complete", "author": "Pastor Sam Shepherd", "updated_at": "05/08/2012", "id": 756434911, "visible_to": [ "Account Admin", "User Admin" ], "author_id": 946060874 "file_attachments": [ { "authenticated_s3_url": "https://aws....", "filename": "list_of_sins.pdf" }] }

Users | Notes Create

POST /users/:user_id/notes/

Example

https://api.onthecity.org/users/452617/notes?body=BANNED!&visible_to=User Admin

{
  "body": "This is the note body",
  "visible_to": [
    "User Admin", "Account Admin"
  ]
}

Required Permissions

User Admin

Parameters

body = ["This is the body of the super secret note!]

visible_to = ["API Admin" | "Account Admin" | "Designer" | "Financial User" | "Group Admin" | "Process User" | "Reporting User" | "Resource Admin" | "Support Admin" | "User Admin"]

Return Data

HTTP 200 OK { "created_at": "05/08/2012", "body": "Deaconship is complete", "author": "Pastor Sam Shepherd", "updated_at": "05/08/2012", "id": 756434911, "visible_to": [ "Account Admin", "User Admin" ], "author_id": 946060874 }

Users | Processes Index

GET /users/:user_id/processes

Example

https://api.onthecity.org/users/452617/processes

Required Permissions

Process User

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 1, "total_pages": 1, "per_page": 20, "processes": [ { "name": "Member Process", "id": 241832976, "state": "complete" }], "current_page": 1 }

Users | Processes Show

GET /users/:user_id/processes/:id

Example

https://api.onthecity.org/users/452617/processes/121313

Required Permissions

Process User

Parameters

N/A

Return Data

HTTP 200 OK { "name": "Member Process", "id": 241832976, "state": "complete" }

Users | Processes | Answers Index

GET /users/:user_id/processes/:process_id/answers

Example

https://api.onthecity.org/users/452617/processes/12343/answers

Required Permissions

Process User

Parameters

page = [1, 2, ...]

RETURN DATA

HTTP 200 OK { "total_entries": 3, "total_pages": 1, "per_page": 20, "answers": [ { "question_id": 702, "required": true, "question": "Question 2", "answered_at": "05/01/2012 11:34 PM (UTC)", "answer": "Please help me!!!" },{ "question_id": 701, "required": true, "question": "Question 1", "answered_at": "05/01/2012 11:34 PM (UTC)", "answer": "I think this is lame!" },{ "question_id": 700, "required": true, "question": "Done?", "answered_at": "05/01/2012 11:34 PM (UTC)", "answer": "1" }] }

Users | Processes | Notes Index

GET /users/:user_id/processes/:process_id/notes

Example

https://api.onthecity.org/users/452617/processes/12343/notes

Required Permissions

Process User

Parameters

page = [1, 2, ...]

RETURN DATA

HTTP 200 OK { "total_entries": 1, "total_pages": 1, "notes": [ { "created_at": "05/01/2012 03:26 AM (UTC)", "body": "This guys needs serious help!!", "author": "Pastor Sam Shepherd (946060874)" }], "per_page": 20, "current_page": 1 }

Users | Roles Index

GET /users/:user_id/roles

Example

https://api.onthecity.org/users/452617/roles

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

RETURN DATA

HTTP 200 OK { "total_entries": 22, "total_pages": 2, "per_page": 20, "current_page": 1 "roles": [ { "group_name": "The Group", "created_at": "05/11/2009", "group_api_url": "https://api.onthecity.org/admin/groups/1245", "title": "Participant", "group_type": "Campus", "group_id": 1245, "id": 75530, "last_engaged": "01/24/2012", "active": true }, { ... } ] }

Users | Roles Show

GET /users/:user_id/roles/:id

Example

https://api.onthecity.org/users/452617/roles/1234

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group_name": "The Group", "created_at": "05/11/2009", "group_api_url": "https://api.onthecity.org/admin/groups/1245", "title": "Participant", "group_type": "Campus", "group_id": 1245, "id": 75530, "last_engaged": "01/24/2012", "active": true }

Users | Roles Create

POST /users/:user_id/roles

Example

https://api.onthecity.org/users/452617/roles?group_id=12345&title=Leader

Notes

You can only create roles for Offline Users. Online Users require an invitation to create a role.

Required Permissions

User Admin

Parameters

group_id = [123456789]

title = ["Leader" | "Manager" | "Volunteer" | "Participant"]

Return Data

HTTP 204 ROLE SCHEDULED FOR CREATION

Users | Roles Destroy

DELETE /users/:user_id/roles/:id

Example

https://api.onthecity.org/users/452617/roles/1234

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 204 Role Deleted Successfully

Users | Roles Activate

PUT /users/:user_id/roles/:id/activate

Example

https://api.onthecity.org/users/452617/roles/1234/activate

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group_name": "The Group", "created_at": "05/11/2009", "group_api_url": "https://api.onthecity.org/admin/groups/1245", "title": "Participant", "group_type": "Campus", "group_id": 1245, "id": 75530, "last_engaged": "01/24/2012", "active": true }

Users | Roles Deactivate

PUT /users/:user_id/roles/:id/deactivate

Example

https://api.onthecity.org/users/452617/roles/1234/deactivate

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group_name": "The Group", "created_at": "05/11/2009", "group_api_url": "https://api.onthecity.org/admin/groups/1245", "title": "Participant", "group_type": "Campus", "group_id": 1245, "id": 75530, "last_engaged": "01/24/2012", "active": false }

Users | Roles Promote

PUT /users/:user_id/roles/:id/promote

Example

https://api.onthecity.org/users/452617/roles/1234/promote?title=Manager

Required Permissions

User Admin

Parameters

title  = ["Leader" | "Manager" | "Volunteer" | "Participant"]

Return Data

HTTP 200 OK { "group_name": "The Group", "created_at": "05/11/2009", "group_api_url": "https://api.onthecity.org/admin/groups/1245", "title": "Manager", "group_type": "Campus", "group_id": 1245, "id": 75530, "last_engaged": "01/24/2012", "active": true }

Users | Roles Demote

PUT /users/:user_id/roles/:id/demote

Example

https://api.onthecity.org/users/452617/roles/1234/demote?title=Participant

Required Permissions

User Admin

Parameters

title = ["Leader" | "Manager" | "Volunteer" | "Participant"]

Return Data

HTTP 200 OK { "group_name": "The Group", "created_at": "05/11/2009", "group_api_url": "https://api.onthecity.org/admin/groups/1245", "title": "Participant", "group_type": "Campus", "group_id": 1245, "id": 75530, "last_engaged": "01/24/2012", "active": true }

Users | Skills Index

GET /users/:user_id/skills

Example

https://api.onthecity.org/users/452617/skills

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 3, "total_pages": 1, "per_page": 20, "current_page": 1, "skills": [ { "name": "Art", "skill_id": 1046429012 },{ "name": "Teaching-Curriculum", "skill_id": 1046429013 },{ "name": "Trade-Automotive", "skill_id": 1046429013 }] }

Users | Skills Create

POST /users/:user_id/skills

Example

https://api.onthecity.org/users/452617/skills?name=Art-Photography

Required Permissions

User Admin

Parameters

name = ["Skill-Name"]

skill_id = 123456

† either name or skill_id required

Return Data

HTTP 200 OK { "total_entries": 3, "total_pages": 1, "per_page": 20, "current_page": 1, "skills": [ { "name": "Art", "skill_id": 1046429012 },{ "name": "Art-Photography", "skill_id": 1046429013 },{ "name": "Teaching-Curriculum", "skill_id": 1046429014 },{ "name": "Trade-Automotive", "skill_id": 1046429015 }] }

Users | Skills Destroy

DELETE /users/:user_id/skills/:id

Example

https://api.onthecity.org/users/452617/skills/Trade-Automotive

Required Permissions

User Admin

Parameters

:id = ["Name" | 12345]

Return Data

HTTP 204 Skill Successfully Removed

Groups Index

GET /groups

Example

https://api.onthecity.org/groups?search=john

Required Permissions

Group Admin

Parameters

page = [1,2,3,4,...]

search = ["downtown" | etc] <- optional group name search

under_group_id = [ 1234 | etc ] <- defaults to church group's ID

group_types = ["CG" | "Service" | "Campus" | etc] <- defaults to all group types

include_inactive = [ true | false ] <- defaults to false

include_addresses = [ true | false ]

include_composition = [ true | false ]

include_user_ids = [ true | false ]

Return Data

HTTP 200 OK { "total_entries": 72, "total_pages": 4, "per_page": 20, "current_page": 1, "groups": [ { "name": "The Group", "admin_url": "http://church.onthecity.org/admin/groups/1001864604", "created_at": "07/03/2012 12:39 PM (UTC)", "profile_pic": "https://church.onthecity.org/images/default_group_large.jpg", "campus_name": "Shoreline", "nearest_neighborhood_id": null, "started_as_seed": false, "nickname": null, "updated_at": "07/03/2012 12:39 PM (UTC)", "inactive": false, "target_size": 15, "internal_url": "http://church.onthecity.org/groups/1001864604", "external_id": null, "group_type": "Service", "unlisted": false, "id": 1001864604, "secure": false, "default_invitation_custom_message": null, "nearest_neighborhood_name": null, "last_engaged": "", "plaza_url": "http://church.onthecity.org/plaza?group_id=1001864604", "parent_id": 935266297, "campus_id": 918508451, "archive_scheduled": false, "time_zone": null, "external_description": "kiddos", "auto_approve_invites": false, "deletion_scheduled": false, "api_url": "https://api.onthecity.org/groups/1001864604" }, { ... } ] }

Groups Show

GET /groups/:id

Example

https://api.onthecity.org/groups/1445

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "name": "The Group", "admin_url": "http://church.onthecity.org/admin/groups/1001864604", "created_at": "07/03/2012 12:39 PM (UTC)", "profile_pic": "https://church.onthecity.org/images/default_group_large.jpg", "campus_name": "Shoreline", "nearest_neighborhood_id": null, "started_as_seed": false, "nickname": null, "updated_at": "07/03/2012 12:39 PM (UTC)", "inactive": false, "target_size": 15, "internal_url": "http://church.onthecity.org/groups/1001864604", "external_id": null, "group_type": "Service", "unlisted": false, "id": 1001864604, "secure": false, "default_invitation_custom_message": null, "nearest_neighborhood_name": null, "last_engaged": "", "plaza_url": "http://church.onthecity.org/plaza?group_id=1001864604", "parent_id": 935266297, "campus_id": 918508451, "archive_scheduled": false, "time_zone": null, "external_description": "kiddos", "auto_approve_invites": false, "deletion_scheduled": false, "api_url": "https://api.onthecity.org/groups/1001864604" }

Groups Create

POST /groups/

Example

https://api.onthecity.org/groups?name=Adoptions&group_type=Other&parent_id=1234

Required Permissions

Group Admin

Parameters

name = ["Unique String"]

parent_id = [12345] <- id of the parent group

group_type = ["CG" | "Campus" | etc]

description = ["string"]

hide_topics = [true | false]

hide_events = [true | false]

hide_prayers = [true | false]

hide_needs = [true | false]

hide_albums = [true | false]

open_topic_creation = [true | false]

open_event_creation = [true | false]

open_prayer_creation = [true | false]

open_need_creation = [true | false]

open_album_creation = [true | false]

target_size = ["string"]

secure = [true | false] 

unlisted = [true | false] 

nickname = ["Unique string"]

auto_approve_invites = [true | false]

Return Data

HTTP 200 OK { "name": "The Group", "admin_url": "http://church.onthecity.org/admin/groups/1445", "created_at": "2009-03-16T03:39:05-07:00", "started_as_seed": false, "offline_user_ids": [ 94769, ... ], "campus_name": "The Campus", ...same as Group#show... }

Groups Update

PUT /groups/:id

Example

https://api.onthecity.org/groups/12344
{"secure":true,"description":"A secure group that is secure"}

Required Permissions

Group Admin

Parameters

name = ["Unique String"]

parent_id = [12345] <- id of the parent group

group_type = ["CG" | "Campus" | etc]

description = ["string"]

hide_topics = [true | false]

hide_events = [true | false]

hide_prayers = [true | false]

hide_needs = [true | false]

hide_albums = [true | false]

open_topic_creation = [true | false]

open_event_creation = [true | false]

open_prayer_creation = [true | false]

open_need_creation = [true | false]

open_album_creation = [true | false]

target_size = ["string"]

secure = [true | false] 

unlisted = [true | false] 

nickname = ["Unique string"]

auto_approve_invites = [true | false]

Return Data

HTTP 200 OK { "name": "The Group", "admin_url": "http://church.onthecity.org/admin/groups/1445", "created_at": "2009-03-16T03:39:05-07:00", "started_as_seed": false, "offline_user_ids": [ 94769, ... ], "campus_name": "The Campus", ...same as Group#show... }

Groups Count

GET /groups/count

Example

https://api.onthecity.org/groups/count?group_types=CG,Service

Required Permissions

Group Admin

Parameters

search = ["downtown" | etc] <- optional group name search

under_group_id = [ 1234 | etc ] <- defaults to church group's ID

group_types = ["CG" | "Service" | "Campus" | etc] <- defaults to all group types

include_inactive = [ true | false ] <- defaults to false
    

Return Data

{ "count": 82, "search": null, "under_group_id": 123456, "group_types":[ "Service", CG" ] "include_inactive": false }

Groups Schedule Archive

PUT /groups/:id/schedule_archive

Example

https://api.onthecity.org/groups/452617/schedule_archive

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "name": "The Group", "admin_url": "http://church.onthecity.org/admin/groups/1001864604", "created_at": "07/03/2012 12:39 PM (UTC)", "profile_pic": "https://church.onthecity.org/images/default_group_large.jpg", "campus_name": "Shoreline", "nearest_neighborhood_id": null, "started_as_seed": false, "nickname": null, "updated_at": "07/03/2012 12:39 PM (UTC)", "inactive": false, "target_size": 15, "internal_url": "http://church.onthecity.org/groups/1001864604", "external_id": null, "group_type": "Service", "unlisted": false, "id": 1001864604, "secure": false, "default_invitation_custom_message": null, "nearest_neighborhood_name": null, "last_engaged": "", "plaza_url": "http://church.onthecity.org/plaza?group_id=1001864604", "parent_id": 935266297, "campus_id": 918508451, "archive_scheduled": true, "time_zone": null, "external_description": "kiddos", "auto_approve_invites": false, "deletion_scheduled": false, "api_url": "https://api.onthecity.org/groups/1001864604" }

Groups Schedule Deletion

PUT /groups/:id/schedule_deletion

Example

https://api.onthecity.org/groups/452617/schedule_deletion

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "name": "The Group", "admin_url": "http://church.onthecity.org/admin/groups/1001864604", "created_at": "07/03/2012 12:39 PM (UTC)", "profile_pic": "https://church.onthecity.org/images/default_group_large.jpg", "campus_name": "Shoreline", "nearest_neighborhood_id": null, "started_as_seed": false, "nickname": null, "updated_at": "07/03/2012 12:39 PM (UTC)", "inactive": false, "target_size": 15, "internal_url": "http://church.onthecity.org/groups/1001864604", "external_id": null, "group_type": "Service", "unlisted": false, "id": 1001864604, "secure": false, "default_invitation_custom_message": null, "nearest_neighborhood_name": null, "last_engaged": "", "plaza_url": "http://church.onthecity.org/plaza?group_id=1001864604", "parent_id": 935266297, "campus_id": 918508451, "archive_scheduled": false, "time_zone": null, "external_description": "kiddos", "auto_approve_invites": false, "deletion_scheduled": true, "api_url": "https://api.onthecity.org/groups/1001864604" }

Groups Undo Scheduled Archive

PUT /groups/:id/undo_scheduled_archive

Example

https://api.onthecity.org/groups/452617/undo_scheduled_archive

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "name": "The Group", "admin_url": "http://church.onthecity.org/admin/groups/1001864604", "created_at": "07/03/2012 12:39 PM (UTC)", "profile_pic": "https://church.onthecity.org/images/default_group_large.jpg", "campus_name": "Shoreline", "nearest_neighborhood_id": null, "started_as_seed": false, "nickname": null, "updated_at": "07/03/2012 12:39 PM (UTC)", "inactive": false, "target_size": 15, "internal_url": "http://church.onthecity.org/groups/1001864604", "external_id": null, "group_type": "Service", "unlisted": false, "id": 1001864604, "secure": false, "default_invitation_custom_message": null, "nearest_neighborhood_name": null, "last_engaged": "", "plaza_url": "http://church.onthecity.org/plaza?group_id=1001864604", "parent_id": 935266297, "campus_id": 918508451, "archive_scheduled": false, "time_zone": null, "external_description": "kiddos", "auto_approve_invites": false, "deletion_scheduled": false, "api_url": "https://api.onthecity.org/groups/1001864604" }

Groups Undo Scheduled Deletion

PUT /groups/:id/undo_scheduled_deletion

Example

https://api.onthecity.org/groups/452617/undo_schedule_deletion

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "name": "The Group", "admin_url": "http://church.onthecity.org/admin/groups/1001864604", "created_at": "07/03/2012 12:39 PM (UTC)", "profile_pic": "https://church.onthecity.org/images/default_group_large.jpg", "campus_name": "Shoreline", "nearest_neighborhood_id": null, "started_as_seed": false, "nickname": null, "updated_at": "07/03/2012 12:39 PM (UTC)", "inactive": false, "target_size": 15, "internal_url": "http://church.onthecity.org/groups/1001864604", "external_id": null, "group_type": "Service", "unlisted": false, "id": 1001864604, "secure": false, "default_invitation_custom_message": null, "nearest_neighborhood_name": null, "last_engaged": "", "plaza_url": "http://church.onthecity.org/plaza?group_id=1001864604", "parent_id": 935266297, "campus_id": 918508451, "archive_scheduled": false, "time_zone": null, "external_description": "kiddos", "auto_approve_invites": false, "deletion_scheduled": false, "api_url": "https://api.onthecity.org/groups/1001864604" }

Groups Unarchive

PUT /groups/:id/unarchive

Example

https://api.onthecity.org/groups/452617/unarchive

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "name": "The Group", "admin_url": "http://church.onthecity.org/admin/groups/1001864604", "created_at": "07/03/2012 12:39 PM (UTC)", "profile_pic": "https://church.onthecity.org/images/default_group_large.jpg", "campus_name": "Shoreline", "nearest_neighborhood_id": null, "started_as_seed": false, "nickname": null, "updated_at": "07/03/2012 12:39 PM (UTC)", "inactive": false, "target_size": 15, "internal_url": "http://church.onthecity.org/groups/1001864604", "external_id": null, "group_type": "Service", "unlisted": false, "id": 1001864604, "secure": false, "default_invitation_custom_message": null, "nearest_neighborhood_name": null, "last_engaged": "", "plaza_url": "http://church.onthecity.org/plaza?group_id=1001864604", "parent_id": 935266297, "campus_id": 918508451, "archive_scheduled": false, "time_zone": null, "external_description": "kiddos", "auto_approve_invites": false, "deletion_scheduled": false, "api_url": "https://api.onthecity.org/groups/1001864604" }

Groups | Addresses Index

GET /groups/:group_id/addresses

Example

https://api.onthecity.org/groups/452617/addresses

Required Permissions

Group Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 2, "total_pages": 1, "addresses": [ { "city": null, created_at": "05/01/2012 12:02 AM (UTC)", "latitude": null, "updated_at": "05/01/2012 12:02 AM (UTC)", "zipcode": null, "id": 1027473242, "street": "5555 Soth Way", "street2": null, "location_type":"Host", "privacy": "Private", "longitude": null, "state": null, "group_id": 452617, "group_external_id": 3421, "friendly_name": "Some House" },{ "city": "Sammamish", "created_at": "04/30/2012 11:54 PM (UTC)", "latitude": 47.60918, "updated_at": "05/01/2012 12:00 AM (UTC)", "zipcode": null, "id": 1027473241, "street": "12345 Main", "street2": null, "location_type": "Host", "privacy": "Private", "longitude": -122.059499, "state": null, "group_id": 452617, "group_external_id": 3421, "friendly_name": "Some House" }], "per_page": 20, "current_page": 1 }

Groups | Addresses Show

GET /groups/:group_id/addresses/:id

Example

https://api.onthecity.org/groups/452617/addresses/1234324

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "city": "Seattle", "created_at": "04/30/2012 08:46 PM (UTC)", "latitude": 47.64114, "updated_at": "04/30/2012 09:34 PM (UTC)", "zipcode": "98109", "id": 552561485, "street": "2547 32nd Ave W", "street2": null, "location_type": "Host", "privacy": "Public", "longitude": -122.398326, "state": "WA", "group_id": 452617, "group_external_id": 3421 }

Groups | Addresses Create

POST /groups/:group_id/addresses

Example

https://api.onthecity.org/groups/452617/addresses
{"street":"24720 SE 31st Pl","city":"Issaquah"}

Required Permissions

Group Admin

Parameters

street = ["1234 Main St"]

street2 = ["Apt 45"]

city = ["Seattle"]

state = ["WA"]

zipcode = ["98064"]

location_type = ["Host"]

friendly_name = ["My House"]

Return Data

HTTP 200 OK { "city": null, "created_at": "05/01/2012 12:02 AM (UTC)", "latitude": null, "updated_at": "05/01/2012 12:02 AM (UTC)", "zipcode": null, "id": 1027473242, "street": "221 B Baker St", "street2": null, "location_type": null, "privacy": "Private", "longitude": null, "state": null , "group_id": 452617, "group_external_id": 3421, "friendly_name": "My House" }

Groups | Addresses Update

PUT /groups/:group_id/addresses/:id

Example

https://api.onthecity.org/groups/452617/addresses/1234324?zipcode=98109
{"street":"24720 SE 31st Pl","city":"Issaquah"}

Required Permissions

Group Admin

Parameters

street = ["1234 Main St"]

street2 = ["Apt 45"]

city = ["Seattle"]

state = ["WA"]

zipcode = ["98064"]

location_type = ["Host"]

friendly_name = ["My House"]

Return Data

HTTP 200 OK { "city": "Issaquah", "created_at": "04/30/2012 08:46 PM (UTC)", "latitude": 47.64114, "updated_at": "04/30/2012 09:34 PM (UTC)", "zipcode": "98109", "id": 552561485, "street": "2547 32nd Ave W", "street2": null, "location_type": "Host", "privacy": "Private", "longitude": -122.398326, "state": "WA", "group_id": 452617, "group_external_id": 3421, "friendly_name": "My House" }

Groups | Addresses Destroy

DELETE /groups/:group_id/addresses/:id

Example

https://api.onthecity.org/groups/452617/addresses/12345

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 204 Address Deleted Successfuly

Groups | Checkin Events Index

GET /groups/:group_id/checkin_events

Example

https://api.onthecity.org/groups/494538351/checkin_events

Required Permissions

Group Admin

Parameters

        

page = [1, 2, ...]

group_id must belong to a group that is a Checkin group type

target_date (optional) specify date for which to look up checkin events. Default is nearest valid checkin date.

Return Data

HTTP 200 OK { "checkin_events": [ { "ending_at": "04/14/2014 01:30 AM (UTC)", "title": "5 PM Service", "id": null, "group_id": 49861013, "group_name": "Ballard Childrens ministry", "starting_at": "04/14/2014 12:00 AM (UTC)", "shadow_event_ids": [645609818,866253241,1019117294] }, { "ending_at": "04/14/2014 03:30 AM (UTC)", "title": "7 PM Service", "id": null, "group_id": 49861013, "group_name": "Ballard Childrens ministry", "starting_at": "04/14/2014 02:00 AM (UTC)", "shadow_event_ids": [291200781,507828306,796891959] }, { "ending_at": "04/14/2014 05:30 PM (UTC)", "title": "9 AM Service", "id": null, "group_id": 49861013, "group_name": "Ballard Childrens ministry", "starting_at": "04/14/2014 04:00 PM (UTC)", "shadow_event_ids": [838961283,1025380312,1050396810] }, { "ending_at": "04/14/2014 07:30 PM (UTC)", "title": "11 AM Service", "id": null, "group_id": 49861013, "group_name": "Ballard Childrens ministry", "starting_at": "04/14/2014 06:00 PM (UTC)", "shadow_event_ids": [626221602,873585808,990796761] } ], "total_entries": 4, "total_pages": 1, "per_page": 20, "current_page": 1, "target_date": "2014-04-18" }

Groups | Checkins Index

GET /groups/:group_id/checkins

Example

https://api.onthecity.org/groups/494538351/checkins

Required Permissions

Group Admin

Parameters

page = [1, 2, ...]

include_checked_out = [ true | false ]

Return Data

HTTP 200 OK { "checkins": [ { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }, {...} ], "total_entries": 2, "total_pages": 1, "per_page": 20, "current_page": 1 }

Groups | Checkins Show

GET /groups/:group_id/checkins/:id

Example

https://api.onthecity.org/groups/494538351/checkins/3

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }

Groups | Event Attendances Index

GET /groups/:group_id/event_attendances

Example

https://api.onthecity.org/groups/452617/event_attendances

Required Permissions

Group Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "event_attendances": [ { "user": "Johnny Smith", "created_at": "07/29/2012", "event_title": "9 AM Service", "event_id": 84326420, "updated_at": "08/01/2012", "tracked_by": "Pastor Sam Shepherd", "id": 980190964, "user_id": 1023606148, "attended_on": "07/29/2012 04:00 PM (UTC)", "tracked_by_user_id": 946060874, "checkin_id": 235323 }, { "user": "Slim Shady", "created_at": "07/29/2012", "event_title": "9 AM Service", "event_id": 161282077, "updated_at": "08/01/2012", "tracked_by": "Pastor Sam Shepherd", "id": 980190966, "user_id": 264535063, "attended_on": "07/29/2012 04:00 PM (UTC)", "tracked_by_user_id": 946060874, "checkin_id": null }, { "user": "Steve Mobs", "created_at": "08/01/2012", "event_title": "past event number 3", "event_id": 757552859, "updated_at": "08/01/2012", "tracked_by": "John Leaderman", "id": 980190976, "user_id": 839047027, "attended_on": "07/05/2012 04:00 PM (UTC)", "tracked_by_user_id": 830138774, "checkin_id": null } ], "current_page": 1, "total_entries": 3, "total_pages": 1, "per_page": 20, }

Groups | Event Attendances Show

GET /groups/:group_id/event_attendances/:id

Example

https://api.onthecity.org/groups/452617/event_attendances/980190964

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "user": "Slim Shady", "created_at": "07/29/2012", "event_title": "9 AM Service", "event_id": 84326420, "updated_at": "08/01/2012", "tracked_by": "Pastor Sam Shepherd", "id": 980190964, "user_id": 1023606148, "attended_on": "07/29/2012 04:00 PM (UTC)", "tracked_by_user_id": 946060874, "checkin_id": 235323 }

Groups | Exports Index

GET /groups/:group_id/exports

Example

https://api.onthecity.org/groups/4367/exports

Required Permissions

Group Admin

Parameters

page = [1,2,3,...]

Return Data

HTTP 200 OK { "total_entries": 1, "total_pages": 1, "per_page": 20, "current_page": 1, "exports": [ { "created_at": "01/13/2012 01:15 AM (EST)", "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity/dms_reports%2F58560%2FGroupExport_01_12_2012__10_15_21PM.csv?Signature=P6%2FKfwqmD4O6ovVSgb8pENkPEmc%3D&Expires=1328582051&AWSAccessKeyId=0APJ343XSHNJKBJZXY82", "id": 58560, "state": "complete" }] }

Groups | Exports Show

GET /groups/:group_id/exports/:id

Example

https://api.onthecity.org/groups/4367/exports/58560

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "created_at": "01/12/2012 10:15 PM (PST)", "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity/dms_reports%2F58560%2FGroupExport_01_12_2012__10_15_21PM.csv?Signature=CMeuhOgNY%2BLS%2FjGrGIAgWDG3JJQ%3D&Expires=1328589584&AWSAccessKeyId=0APJF43DSH43KBJZXY82", "id": 58560, "state": "complete" }

Groups | Exports Create

POST /groups/:group_id/exports

Example

https://api.onthecity.org/groups/4367/exports

Required Permissions

Group Admin

Parameters

user_type = ["OfflineUsers" | "Users"]

Return Data

HTTP 202 Accepted { "created_at": "02/06/2012 11:36 PM (EST)", "authenticated_s3_url": "", "id": 62706, "state": "inqueue" }

Groups | Health Assessments Index

GET /groups/:group_id/health_assessments

Example

https://api.onthecity.org/groups/4367/health_assessments

Required Permissions

Group Admin

Parameters

page = [1,2,3,...]

Return Data

HTTP 200 OK { "health_assessments": [ { "notes": "Doing well!", "category_name": "Confession & Repentance", "assessed_at": "07/03/2012", "id": 895672081, "value": 0.0 }, { "notes": "Needs work.", "category_name": "Stewardship", "assessed_at": "07/03/2012", "id": 606629653, "value": -2.0 }, { ... } ], "total_entries": 50, "total_pages": 3, "per_page": 20, "current_page": 1 }

Groups | Invitations Index

GET /groups/:group_id/invitations

Example

https://api.onthecity.org/groups/1234/invitations

Required Permissions

Group Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 1, "total_pages": 1, "per_page": 20, "current_page": 1, "invitations": [ { "title": "Participant", "created_at": "02/06/2012", "pending_approval": false, "group_id": 5812, "id": 1696907, "user_id": 14347, "custom_message": "Join!", "source": "API Invite | Groupy Group (5812) on 2012-02-06 at 17:01", "member_since": null, "email": "theusers@email.com", "name": null, "external_id_1": null, "external_id_2": null, "external_id_3": null, "member_since": null }] }

Groups | Invitations Create

POST /groups/:group_id/invitations

Example

https://api.onthecity.org/groups/4321/invitations?email=user4@geemail.org&custom_message=Join!

Required Permissions

Group Admin

Parameters

 user_id = [12345]

 external_id_1 = ["12345"]

 email = ["user@domain.org"]

custom_message = ["Please join the group!"]

at least one of these is required

Return Data

HTTP 200 OK { "title": "Participant", "created_at": "02/06/2012", "pending_approval": false, "group_id": 5812, "id": 1696907, "user_id": 14347, "custom_message": "Join!", "source": "API Invite | Groupy Group (5812) on 2012-02-06 at 17:01", "member_since": null, "email": "theusers@email.com", "external_id_1": null, "external_id_2": null, "external_id_3": null }

Groups | Roles Index

GET /groups/:group_id/roles

Example

https://api.onthecity.org/groups/4367/roles

Required Permissions

Group Admin

Parameters

page = [1,2,3,...]

title = ["Leaders" | "Managers" | "Volunteers" | "Participants" | "Inactive"]

include_inactive = [true | false]

Return Data

HTTP 200 OK { "total_entries": 53, "total_pages": 3, "per_page": 20, "roles": [ { "created_at": "04/30/2012", "title": null, "user_api_url": "https://api.onthecity.org/users/494335566", "id": 265005445, "user_type": "Offline User", "user_id": 494335566, "last_engaged": null, "user_name": "Joe Offline", "active": true }, { ... } ] }

Groups | Roles Show

GET /groups/:group_id/roles/:id

Example

https://api.onthecity.org/groups/452617/roles/265005445

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "created_at": "04/30/2012", "title": null, "user_api_url": "https://api.onthecity.org/users/494335566", "id": 265005445, "user_type": "Offline User", "user_id": 494335566, "last_engaged": null, "user_name": "Joe Offline", "active": true }

Groups | Roles Create

POST /groups/:group_id/roles

Example

https://api.onthecity.org/groups/452617/roles?user_id=12345&title=Leader

Required Permissions

Group Admin

Parameters

user_id = [123456789]

title = ["Leader" | "Manager" | "Volunteer" | "Participant"]

Return Data

HTTP 204 ROLE SCHEDULED FOR CREATION

Groups | Roles Destroy

DELETE /groups/:group_id/roles/:id

Example

https://api.onthecity.org/groups/452617/roles/1234

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 204 Role Deleted Successfully

Groups | Roles Activate

PUT /groups/:group_id/roles/:id/activate

Example

https://api.onthecity.org/groups/452617/roles/1234/activate

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "created_at": "04/30/2012", "title": null, "user_api_url": "https://api.onthecity.org/users/494335566", "id": 265005445, "user_type": "Offline User", "user_id": 494335566, "last_engaged": null, "user_name": "Joe Offline", "active": true }

Groups | Roles Deactivate

PUT /groups/:group_id/roles/:id/deactivate

Example

https://api.onthecity.org/groups/452617/roles/1234/deactivate

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "created_at": "04/30/2012", "title": null, "user_api_url": "https://api.onthecity.org/users/494335566", "id": 265005445, "user_type": "Offline User", "user_id": 494335566, "last_engaged": null, "user_name": "Joe Offline", "active": false }

Groups | Roles Promote

PUT /groups/:group_id/roles/:id/promote

Example

https://api.onthecity.org/groups/452617/roles/1234/promote?title=Manager

Required Permissions

Group Admin

Parameters

title = ["Leader" | "Manager" | "Volunteer" | "Participant"]

Return Data

HTTP 200 OK { "created_at": "04/30/2012", "title": "Manager, "user_api_url": "https://api.onthecity.org/users/494335566", "id": 265005445, "user_type": "User", "user_id": 494335566, "last_engaged": null, "user_name": "Joe Smith", "active": true }

Groups | Roles Demote

PUT /groups/:group_id/roles/:id/demote

Example

https://api.onthecity.org/groups/452617/roles/1234/demote?title=Participant

Required Permissions

Group Admin

Parameters

title = ["Leader" | "Manager" | "Volunteer" | "Participant"]

Return Data

HTTP 200 OK { "created_at": "04/30/2012", "title": "Participant", "user_api_url": "https://api.onthecity.org/users/494335566", "id": 265005445, "user_type": "User", "user_id": 494335566, "last_engaged": null, "user_name": "Joe Smith", "active": true }

Groups | Roles Deactivate All

POST /groups/:group_id/roles/deactivate_all

Example

https://api.onthecity.org/groups/452617/roles/deactivate_all

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 204 ROLES SCHEDULED FOR DEACTIVATION

Groups | Tags Index

GET /groups/:group_id/tags

Example

https://api.onthecity.org/groups/4367/tags

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "total_entries": 3, "total_pages": 1, "tags": [ { "name": "Evening", "tag_id": 130003696 },{ "name": "Meals", "tag_id": 106828901 },{ "name": "Monday", "tag_id": 78603717 } ], "per_page": 20, "current_page": 1 }

Groups | Tags Create

POST /groups/:group_id/tags

Example

https://api.onthecity.org/groups/452617/tags?name=Meals

Required Permissions

Group Admin

Parameters

name = ["Skill-Name"]

tag_id = 123456

either name or tag_id required

Return Data

HTTP 200 OK { "total_entries": 3, "total_pages": 1, "tags": [ { "name": "Evening", "tag_id": 130003696 },{ "name": "Meals", "tag_id": 106828901 },{ "name": "Monday", "tag_id": 78603717 } ], "per_page": 20, "current_page": 1 }

Groups | Tags Destroy

DELETE /groups/:group_id/tags/:id

Example

https://api.onthecity.org/groups/452617/tags/Evening

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 204 Tag Removed Successfully

Addresses Index

GET /addresses

Example

https://api.onthecity.org/addresses

Notes

Returns all the public addresses for groups and users.

Required Permissions

User Admin or Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "total_entries": 2, "total_pages": 1, "addresses": [ { "city": "Seattle", "created_at": "04/30/2012 08:46 PM (UTC)", "latitude": 47.770476, "updated_at": "04/30/2012 08:46 PM (UTC)", "zipcode": null, "group_id": 918508451, "group_external_id": 3421 "id": 42361089, "street": "Greenwood Ave N & N 195th St", "street2": null, "location_type": "Host", "privacy": "Public", "longitude": -122.355764, "state": "WA", "friendly_name": "Host House" },{ "city": "Seattle", "created_at": "04/30/2012 08:46 PM (UTC)", "latitude": 47.663641, "updated_at": "05/03/2012 09:22 PM (UTC)", "zipcode": "", "user_id": 839047027, "user_external_id": 3421 "id": 65067329, "street": "1203 NW Leary way", "street2": null, "location_type": "Home", "privacy": "Public", "longitude": -122.370763, "state": "WA", "friendly_name": "My House" }], "per_page": 20, "current_page": 1 }

Addresses Show

GET /addresses/:id

Example

https://api.onthecity.org/addresses/65067329

Required Permissions

User Admin or Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "city": "Seattle", "created_at": "04/30/2012 08:46 PM (UTC)", "latitude": 47.663641, "updated_at": "05/03/2012 09:22 PM (UTC)", "zipcode": "", "group_id": 839047027, "group_external_id": 3421 "id": 65067329, "street": "1203 NW Leary way", "street2": null, "location_type": "Host", "privacy": "Public", "longitude": -122.370763, "state": "WA", "friendly_name": "My House" }

Addresses | Groups Index

GET /addresses/groups

Example

https://api.onthecity.org/addresses/groups?group_types=CG&under_group_id=1234

Notes

Returns all the public addresses that belong to groups. You can filter by group types, and filter by groups that reside under a particular group in the group tree hierarchy.

Required Permissions

Group Admin

Parameters

page = [1,2,3,...]

group_types = ["CG,Service" | "Life,CustomType,Seed" | etc]

under_group_id = [12333423]

Return Data

HTTP 200 OK { "total_entries": 2, "total_pages": 1, "addresses": [ { "city": "Seattle", "created_at": "04/30/2012 08:46 PM (UTC)", "latitude": 47.770476, "updated_at": "04/30/2012 08:46 PM (UTC)", "zipcode": null, "group_id": 918508451, "id": 42361089, "street": "Greenwood Ave N & N 195th St", "street2": null, "location_type": "Host", "privacy": "Public", "longitude": -122.355764, "state": "WA", "friendly_name": "Some House" },{ "city": "Seattle", "created_at": "04/30/2012 08:46 PM (UTC)", "latitude": 47.663641, "updated_at": "05/03/2012 09:22 PM (UTC)", "zipcode": "", "group_id": 839047027, "id": 65067329, "street": "1203 NW Leary way", "street2": null, "location_type": "Host", "privacy": "Public", "longitude": -122.370763, "state": "WA", "friendly_name": "Some House" }], "per_page": 20, "current_page": 1 }

Barcodes Show

GET /barcodes/:barcode

Example

https://api.onthecity.org/barcodes/AA987Hg-wyw1288

Required Permissions

User Admin

Parameters

:barcode can be id or barcode

Return Data

HTTP 200 OK { "user_id": 946060874, "user_name": "Pastor Sammy Shepherd", "id": 797572013, "created_at": "05/14/2012", "barcode": "745473117199" }

Campuses Index

GET /campuses

Example

https://api.onthecity.org/campuses

Required Permissions

Group Admin

Parameters

      page = [1,2,3,4,...]
    

Return Data

HTTP 200 OK { "total_entries": 13, "total_pages": 1, "per_page": 20, "current_page": 1, "campuses": [ { "id": 34534533, "name": "Downtown Campus" }, { ... } ] } * Note that this is the same as the Groups#index endpoint with the parameter of group_types=Campus

Campuses Show

GET /campuses/:id

Example

https://api.onthecity.org/campuses/34234345

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "id": 34234345, "name": "Our City Church" }

Checkins Index

GET /checkins

Example

https://api.onthecity.org/checkins

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

include_checked_out = [ true | false ]

Return Data

HTTP 200 OK { "checkins": [ { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }, {...} ], "total_entries": 2, "total_pages": 1, "per_page": 20, "current_page": 1 }

Checkins Show

GET /checkins/:id

Example

https://api.onthecity.org/checkins/3456

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }

Checkins By Barcode

GET /checkins/by_barcode/:barcode

Example

https://api.onthecity.org/checkins/by_barcode/12BB97E001

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }

Checkins By Callboard Number

GET /checkins/by_callboard_number/:number

Example

https://api.onthecity.org/checkins/by_callboard_number/102

Required Permissions

User Admin

Parameters

        

page = [1, 2, ...]

include_checked_out = [ true | false ]

under_checkin_group_id = allows you to narrow checkins to those under a particular Checkin group

Return Data

HTTP 200 OK { "checkins": [ { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }, {...} ], "total_entries": 2, "total_pages": 1, "per_page": 20, "current_page": 1 }

Checkins By Pager Number

GET /checkins/by_pager_number/:number

Example

https://api.onthecity.org/checkins/by_pager_number/45

Required Permissions

User Admin

Parameters

        

page = [1, 2, ...]

include_checked_out = [ true | false ]

under_checkin_group_id = allows you to narrow checkins to those under a particular Checkin group

Return Data

HTTP 200 OK { "checkins": [ { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }, {...} ], "total_entries": 2, "total_pages": 1, "per_page": 20, "current_page": 1 }

Checkins By Parent Receipt Barcode

GET /checkins/by_parent_receipt_barcode/:barcode

Example

https://api.onthecity.org/checkins/by_parent_receipt_barcode/BC6C285ACE5

Required Permissions

User Admin

Parameters

        

page = [1, 2, ...]

include_checked_out = [ true | false ]

Return Data

HTTP 200 OK { "checkins": [ { "group": { "name": "Third Grade", "external_id": null, "id": 494538351 }, "checked_out_by_user": null, "special_instructions": "No snacks!", "parent_group_name": "Ballard Childrens ministry", "callboard_number": "102", "checked_in_at": "07/16/2012 07:59 PM (UTC)", "barcode": "12BB97E001", "checked_in_user": "Johnny Shepherd", "checked_in_user_id": 282384270, "id": 3, "checked_in_by_user": "Pastor Sam Shepherd", "checked_in_by_user_id": 946060874 "parent_receipt_barcode": "BC6C285ACE5", "event": { "ending_at": "07/10/2012 01:30 AM (UTC)", "title": "5 PM Service", "id": 587598132, "starting_at": "07/10/2012 12:00 AM (UTC)" }, "checked_in_user_notes": "Gluten-Free", "checked_out_at": null, "parent_group_id": 49861013, "pager_number": 45 }, {...} ], "total_entries": 2, "total_pages": 1, "per_page": 20, "current_page": 1 }

Churches Index

GET /churches

Example

https://api.onthecity.org/churches

Required Permissions

Group Admin

Parameters

N/A

Return Data

HTTP 200 OK { "id": 34234345, "name": "Our City Church" } * Note that this is the same as the Groups#index endpoint with the parameter of group_types=Church

Custom Fields Index

GET /custom_fields

Example

https://api.onthecity.org/custom_fields

Required Permissions

none

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "custom_fields": [ { "label": "Marital Status", "id": 0, "multiple_choice": [ "Never Married", "Engaged", "Married", "Separated", "Divorced", "Re-Married", "Widowed" ], "custom_field_type": "multiple", "allow_user_edit": true },{ "label": "MyString", "id": 1, "multiple_choice": [ ], "custom_field_type": "string", "allow_user_edit": false },{ "label": "Baptism Date", "id": 2, "multiple_choice": [ ], "custom_field_type": "date", "allow_user_edit": true },{ "label": "Hot Drink Choice", "id": 3, "multiple_choice": [ "Coffee-Regular", "Coffee-Decaf", "Tea-Earl Grey (Hot)" ], "custom_field_type": "multiple", "allow_user_edit": false }] }

Custom Fields Show

GET /custom_fields/:id

Example

https://api.onthecity.org/custom_fields/MyString

Notes

You can pass in the ID or the label for the :id parameter

Required Permissions

Account Admin

Parameters

N/A

Return Data

HTTP 200 OK { "label": "MyString", "id": 1, "multiple_choice": [ ], "custom_field_type": "string", "allow_user_edit": false }

Custom Fields Create

POST /custom_fields

Example

https://api.onthecity.org/custom_fields?label=Anniversary&custom_field_type=date&allow_user_edit=true

Required Permissions

Account Admin

Parameters

      label = ["Baptism Date" | etc]

      custom_field_type = ["string" | "date" | "multiple"]

      multiple_choice = "[ "An Array", "Of Options" ]"
      
      allow_user_edit = [ true | false ]
    

Return Data

HTTP 200 OK { "label": "Anniversary", "id": 6, "multiple_choice": [ ], "custom_field_type": "date", "allow_user_edit": false }

Custom Fields Update

PUT /custom_fields/:id

Example

https://api.onthecity.org/custom_fields/Singles?label=Singles-Men

Required Permissions

Account Admin

Parameters

label = ["Baptism Date" | etc]

custom_field_type = ["string" | "date" | "multiple"]

multiple_choice = "[ "An Array", "Of Options" ]"
      
allow_user_edit = [ true | false ]
    

Return Data

HTTP 200 OK { "label": "YourString", "id": 1, "multiple_choice": [ ], "custom_field_type": "string", "allow_user_edit": false }

Custom Fields Destroy

DELETE /custom_fields/:id

Example

https://api.onthecity.org/custom_fields/21

Notes

You can pass in the ID or the label for the :id parameter

Required Permissions

Account Admin

Parameters

N/A

Return Data

HTTP 204 Custom Field Deleted Successfully

Custom Fields Users Index

GET /custom_fields/:custom_field_id/users

Example

https://api.onthecity.org/custom_fields/Baptized/users?search=Yes

Notes

Returns all the users that have data stored in this custom field. You can use the search parameter to filter for users who have search in their custom field data. For instance, you could search "2002" on a date custom field named "Baptism Date" to find all the users who got baptized in 2002.

:custom_field_id can be the ID or the label of the custom field

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

include_inactive = [ true | false ] <- defaults to false

search = [ "string" | etc ] <- search custom field data
    

Return Data

HTTP 200 OK { "total_entries": 703, "total_pages": 36, "per_page": 20, "current_page": 1, "users": [ { "admin_url": "http://church.onthecity.org/admin/users/946060874", "api_url": "https://api.onthecity.org/users/946060874", "internal_url": "http://church.onthecity.org/users/946060874", "updated_at": "05/15/2012 07:24 AM (UTC)", "last_logged_in": "05/16/2012 04:52 AM (UTC)", "secondary_phone": "", "last_engaged": "05/16/2012 04:52 AM (UTC)", "title": "Pastor", "internal_url": "http://church.onthecity.org/users/946060874", "id": 946060874, "first": "Sam", "primary_campus_name": null, "last": "Shepherd", "head_of_household": true, "nickname": "Sammy", "active": true, "primary_phone_type": "home", "primary_phone": "", "member_since": "05/14/2012", "birthdate": "1974-11-09", "email_bouncing": false, "secondary_phone_type": "home", "primary_campus_id": null, "contact_updated_at": "05/15/2012 12:24 AM (UTC)", "type": "User", "staff": true, "created_at": "05/14/2012 05:51 PM (UTC)", "gender": "Male", "External ID 3": null, "External ID 2": null, "External ID 1": null, "external_id_1": null, "external_id_2": null, "external_id_3": null, "middle": "", "email": "zack@church.org" }, { ... } ], }

Custom Fields Users Count

GET /custom_fields/:custom_field_id/users/count

Example

https://api.onthecity.org/custom_fields/Baptized/users/count?search=Yes

Notes

Returns a count of all the users that have data stored in this custom field. You can use the search parameter to filter for users who have search in their custom field data. For instance, you could search "2002" on a date custom field named "Baptism Date" to count all the users who got baptized in 2002.

:custom_field_id can be the ID or the label of the custom field

Required Permissions

User Admin

Parameters

include_inactive = [ true | false ] <- defaults to false

search = [ "string" | etc ] <- search custom field data
    

Return Data

HTTP 200 OK { "count": 703, "search": "Yes" }

Donations Index

GET /donations

Example

https://api.onthecity.org/donations?paginate=true&page=2&per_page=100

Notes

Use the optional parameters to filter donations returned. start_date and/or end_date can be sent to scope donations to a time range.

Required Permissions

Financial Admin

Parameters


fund_id = [ 12345, 34567, ... ]

state = [ 'Confirmed' | 'Voided' | 'Pending' ]

group_id = [ 12345, 34567, ... ]

user_id = [ 12345, 34567, ... ]

start_date = [ "1/22/2012" | "2012-1-22" ]

end_date = [ "12/31/2012" | "2012-12-31" ]

created_on = [ "1/22/2012" | "2012-1-22" ]



paginate = [ true | false ]

page = [ 1,2,3,4,... ]

per_page = [ 1,2,3,4,... ]

Return Data

Without Pagination: HTTP 200 OK [ { "split_id": null, "external_id": "", "amount": 919, "id": 678726772, "date": "2012-04-06", "note": null, "instrument": "Check 7572", "state": "Confirmed", "batch_id": 4324, "user": { "name": "Bill Coachman", "id": "975247844" }, "fund": { "name": "Ballard Taxable Fund", "external_id": "", "id": 270670192, "group_id": 823956377 } }, { ... } ] With Pagination: HTTP 200 OK { "total_entries": 10, "total_pages": 1, "per_page": 20, "current_page": 1, "donations": [ { "split_id": null, "external_id": "", "amount": 919, "id": 678726772, "date": "2012-04-06", "note": null, "instrument": "Check 7572", "state": "Confirmed", "batch_id": 4324, "user": { "name": "Bill Coachman", "id": "975247844" }, "fund": { "name": "Ballard Taxable Fund", "external_id": "", "id": 270670192, "group_id": 823956377 } }, { ... } ] }

Donations Show

GET /donations/:id

Example

https://api.onthecity.org/donations/87071

Required Permissions

Financial Admin

Parameters

N/A

Return Data

HTTP 200 OK { "split_id": null, "external_id": "", "amount": 919, "id": 678726772, "date": "2012-04-06", "note": null, "instrument": "Check 7572", "state": "Confirmed", "batch_id": 4324, "user": { "name": "Bill Coachman", "id": "975247844" }, "fund": { "name": "Ballard Taxable Fund", "external_id": "", "id": 270670192, "group_id": 823956377 } }

Donations | Exports Index

GET /donations/exports

Example

https://api.onthecity.org/donations/exports

Required Permissions

Financial Admin

Parameters

page = [1,2,3,4,...]

Return Data

HTTP 200 OK { "total_entries": 10, "total_pages": 1, "per_page": 20, "current_page": 1, "exports": [ { "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity/dms_reports%2F58560%2FDonationsExport_01_12_2012__10_15_21PM.csv?Signature=P6%2FKfwqmD4O6ovVSgb8pENkPEmc%3D&Expires=1328582051&AWSAccessKeyId=0APJ343XSHNJKBJZXY82", "id": 58560, "state": "complete" }] }

Donations | Exports Show

GET /donations/exports/:id

Example

https://api.onthecity.org/donations/exports/58560

Required Permissions

Financial Admin

Parameters

page = [1,2,3,4,...]

Return Data

HTTP 200 OK { "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity/dms_reports%2F58560%2FGroupExport_01_12_2012__10_15_21PM.csv?Signature=P6%2FKfwqmD4O6ovVSgb8pENkPEmc%3D&Expires=1328582051&AWSAccessKeyId=0APJ343XSHNJKBJZXY82", "id": 58560, "state": "complete" }

Donations | Exports Create

POST /donations/exports/

Example

https://api.onthecity.org/donations/exports

Required Permissions

Financial Admin

Parameters


user_id = [23423] <- optional - defaults to all

fund_id = [55555] <- optional - defaults to all

start_date = ["2012-11-01"] <- optional - defaults to all

end_date = ["2012-11-15"] <- optional - defaults is all

Return Data

HTTP 200 OK { "authenticated_s3_url": "http://s3.amazonaws.com:80/thecity/dms_reports%2F58560%2FDonationsExport_01_12_2012__10_15_21PM.csv?Signature=P6%2FKfwqmD4O6ovVSgb8pENkPEmc%3D&Expires=1328582051&AWSAccessKeyId=0APJ343XSHNJKBJZXY82", "id": 58561, "state": "inqueue" }

Donations | Exports Destroy

DELETE /donations/exports/:id

Example

https://api.onthecity.org/donations/exports/58561

Required Permissions

Financial Admin

Parameters

N/A

Return Data

HTTP 204 Donation export removed successfully * To remove an export it must have a state of "complete"

Families Show

GET /families/:id

Example

https://api.onthecity.org/families/122323

Required Permissions

User Admin

Parameters

:id can be id or external_id

Return Data

HTTP 200 OK { "created_at": "04/30/2012 08:46 PM (UTC)", "external_id": "5555", "id": 398768686, "family_members": [ { "name": "Pastor Sam Shepherd", "admin_url": "http://church.onthecity.org/admin/users/946060874", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 946060874, "barcodes": [ { "created_at": "04/30/2012", "barcode": "0987654321", "id": 4343434 }], "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/946060874", "active": true, "email": "zack@onthecity.org" },{ "name": "Deacon Sally Shepherd", "admin_url": "http://church.onthecity.org/admin/users/23838500", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 23838500, "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/23838500", "active": true, "email": "deacon@onthecity.org" },{ "name": "Jack Hubert", "admin_url": "http://church.onthecity.org/admin/users/790725326", "External ID 1": null, "birthdate": "2006-11-09", "user_id": 790725326, "family_role": "Child", "api_url": "https://api.onthecity.org/users/790725326", "active": true, "email": null }] }

Families Create

POST /families

Example

https://api.onthecity.org/families

{ 
"external_id": 464646,
"family_members": [
    { "family_role":"Spouse", "user_id":12345 },
    { "family_role":"Child", "external_id_1":"5-Y678" },
    { "family_role":"Spouse", "email":"aloha@hawaii.net" }
  ]
}

Required Permissions

User Admin

Parameters

external_id = [23234 | "sdfh324" | etc]

family_members = [
  family_role = ["Spouse" | "Other" | Child" | "TempChild" | "LegalChild"]

   user_id = [123122]
  
   external_id_1 = [23234 | "sdfh324" | etc]
  
   email = ["name@domain.biz"]
]

either user_id, external_id_1, or email required for each family_member

Return Data

HTTP 200 OK { "created_at": "04/30/2012 08:46 PM (UTC)", "external_id": "464646", "id": 398768686, "family_members": [ { "name": "Pastor Sam Shepherd", "admin_url": "http://church.onthecity.org/admin/users/946060874", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 946060874, "barcodes": [ { "created_at": "04/30/2012", "barcode": "0987654321", "id": 34234234 }], "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/946060874", "active": true, "email": "zack@onthecity.org" },{ "name": "Deacon Sally Shepherd", "admin_url": "http://church.onthecity.org/admin/users/23838500", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 23838500, "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/23838500", "active": true, "email": "deacon@onthecity.org" },{ "name": "Jack Hubert", "admin_url": "http://church.onthecity.org/admin/users/790725326", "External ID 1": null, "birthdate": "2006-11-09", "user_id": 790725326, "family_role": "Child", "api_url": "https://api.onthecity.org/users/790725326", "active": true, "email": null }] }

Families Update

PUT /families/:id

Example

https://api.onthecity.org/families/12345?external_id=9999

Required Permissions

User Admin

Parameters

:id can be id or external_id

external_id = [123445 | “234423324” | etc]

Return Data

HTTP 200 OK { "created_at": "04/30/2012 08:46 PM (UTC)", "external_id": "5555", "id": 398768686, "family_members": [ { "name": "Pastor Sam Shepherd", "admin_url": "http://church.onthecity.org/admin/users/946060874", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 946060874, "barcodes": [ { "created_at": "04/30/2012", "barcode": "0987654321", "id": 434555 }], "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/946060874", "active": true, "email": "zack@onthecity.org" },{ "name": "Deacon Sally Shepherd", "admin_url": "http://church.onthecity.org/admin/users/23838500", "External ID 1": null, "birthdate": "1974-11-09", "user_id": 23838500, "family_role": "Spouse", "api_url": "https://api.onthecity.org/users/23838500", "active": true, "email": "deacon@onthecity.org" },{ "name": "Jack Hubert", "admin_url": "http://church.onthecity.org/admin/users/790725326", "External ID 1": null, "birthdate": "2006-11-09", "user_id": 790725326, "family_role": "Child", "api_url": "https://api.onthecity.org/users/790725326", "active": true, "email": null }] }

Families Destroy

DELETE /families/:id

Example

https://api.onthecity.org/families/334342

Required Permissions

User Admin

Parameters

:id can be id or external_id

Return Data

HTTP 200 Family successfully destroyed

Funds Index

GET /funds

Example

https://api.onthecity.org/funds

Required Permissions

Financial Admin

Parameters

page = [1,2,3,4,...]

campus_id = [1234]

include_inactive = [ true | false ] <- defaults to false

show_give_online_only = [ true | false ] <- defaults to false

Return Data

HTTP 200 OK { "total_entries": 10, "total_pages": 1, "per_page": 20, "current_page": 1, "funds": [ { "givable": false, "pledge_inactive_date": nil, "fund_state": "active", "updated_at": "11/27/2012 08:22 PM (UTC)", "created_at": "11/27/2012 12:00 AM (UTC)", "pledge_state": "inactive", "pledge_type": "none", "campus_name": "Ballard", "name": "Ballard Taxable Fund", "tax_deductible": false, "pledge_description": nil, "external_id": "", "campus_id": 823956377, "id": 270670192 }, { ... } ] }

Funds Show

GET /funds/:id

Example

https://api.onthecity.org/funds/270670192

Required Permissions

Financial Admin

Parameters

N/A

Return Data

HTTP 200 OK { "givable": false, "pledge_inactive_date": nil, "fund_state": "active", "updated_at": "11/27/2012 08:22 PM (UTC)", "created_at": "11/27/2012 12:00 AM (UTC)", "pledge_state": "inactive", "pledge_type": "none", "campus_name": "Ballard", "name": "Ballard Taxable Fund", "tax_deductible": false, "pledge_description": nil, "external_id": "", "campus_id": 823956377, "id": 270670192 }

Funds Create

POST /funds

Example

https://api.onthecity.org/funds

Required Permissions

Financial Admin

Parameters


name = ["Yearly Pledge Fund"]

external_id = ["A123"]

group_id = [823956377] (this should be the group_id of the church or campus group the fund is attached to)

campus_name = ["The small one"]

givable = [true]

fund_state = ["active" | "inactive"]

pledge_description = ["This is the 2012 Fund"]

pledge_inactive_date = [nil]

pledge_state = ["active" | "inactive"]

pledge_type = ["none" | "general" | "other"]

tax_deductible = [false]
 
    

Return Data

HTTP 200 OK { "givable": false, "pledge_inactive_date": nil, "fund_state": "active", ....Same as Funds#show }

Funds Update

PUT /funds/:id

Example

https://api.onthecity.org/funds/270670192

Required Permissions

Financial Admin

Parameters


name = ["Yearly Pledge Fund"]

external_id = ["A123"]

group_id = [823956377] (this should be the group_id of the church or campus group the fund is attached to)

campus_name = ["The small one"]

givable = [true]

fund_state = ["active" | "inactive"]

pledge_description = ["This is the 2012 Fund"]

pledge_inactive_date = [nil]

pledge_state = ["active" | "inactive"]

pledge_type = ["none" | "general" | "other"]

tax_deductible = [false]

    

Return Data

HTTP 200 OK { "givable": false, "pledge_inactive_date": nil, "fund_state": "active", ....Same as Funds#show }

Funds Index

DELETE /funds/:id

Example

https://api.onthecity.org/funds/270670192

Required Permissions

Financial Admin

Parameters

N/A

Return Data

HTTP 200 OK {"success" : "deleted"} or {"success" : "inactive"} * Funds that do not have donations assigned to them can be deleted, otherwise they can only be marked inactive.

Invitations Index

GET /invitations

Example

https://api.onthecity.org/invitations?filter=with_external_id_1

Required Permissions

User Admin or Group Admin

Parameters

page = [1,2,3,...]

filter = ["with_external_id_1" | "with_external_id_2" | "with_external_id_3" |  "without_external_id_1" | "without_external_id_2" | "without_external_id_3"]

Return Data

HTTP 200 OK { "total_entries": 3, "total_pages": 1, "invitations": [ { "created_at": "04/30/2012", "pending_approval": false, "id": 45332922, "group_id": 114380847, "user_id": 583844167, "custom_message": null, "source": null, "email": "offline@marshillchurch.org", "title": "Participant", "name": null, "external_id_1": null, "external_id_2": null, "external_id_3": null, "member_since": null },{ "created_at": "04/30/2012", "pending_approval": false, "id": 90519936, "group_id": 955136928, "user_id": 1068169463, "custom_message": null, "source": null, "email": null, "title": "Participant", "name": null, "external_id_1": null, "external_id_2": null, "external_id_3": null, "member_since": null },{ "created_at": "04/30/2012", "pending_approval": false, "id": 764636008, "group_id": 631103380, "user_id": 946060874, "custom_message": "You have been invited to a Neighborhood group because of your proximity to this group. Your address will remain private.", "source": "Neighborhood Reset | 2012-04-30 at 14:34", "email": "zack@onthecity.org" , "title": "Participant", "name": null, "external_id_1": null, "external_id_2": null, "external_id_3": null, "member_since": null }], "per_page": 20, "current_page": 1 }

Invitations Bulk Invite

POST /invitations/bulk_invite

Example

https://api.onthecity.org/invitations/bulk_invite

{
  "group_id": 12345,
  "custom_message": "You should join!",
  "title": "Participant",
  "invitees": [
    { "user_id": 12345, "title": "Volunteer" },
    { "email": "markflair@thecity.net", "member_since": "2001-05-15" },
    { "user_external_id_1": "AA-12345", "external_id_3": "some data", "title": "Leader" }
  ]
}

Required Permissions

User Admin or Group Admin

Parameters

 group_id = [12345]

 group_external_id = [ 122334  | "2334AAA" ]

custom_message = ["Welcome to our group!" | etc ]

title = ["Participant" | "Volunteer" | "Manager" | "Participant"] <-- acts as default

invitees = [
  †† user_id = [ 121334 ]
  †† email = ["valid@emailaddress.com"]
  †† user_external_id_1 = [ 1312312 | "3324324AAGG" | etc ]
  title = ["Participant" | "Volunteer" | "Manager" | "Participant"]
  member_since = [ "DD/MM/YYYY" | "YYYY-MM-DD" ]
  external_id_1 = [ 1312312 | "3324324AAGG" | etc ]
  external_id_2 = [ 1312312 | "3324324AAGG" | etc ]
  external_id_3 = [ 1312312 | "3324324AAGG" | etc ]
]

either group_id, group_external_id required
†† either user_id, user_external_id_1, or email required

Return Data

HTTP 202 BULK INVITATIONS ARE BEING DELIVERED

Metrics Index

GET /metrics

Example

https://api.onthecity.org/metrics

Required Permissions

Reporting User

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 44, "total_pages": 3, "per_page": 20, "current_page": 1, "metrics": [ { "name": "Total of all responses to prayer requests", "category": "Activity", "subcategory": null, "id": 5379098, "is_percent": false, "description": null },{ "name": "Total of all posts that came in via email", "category": "Activity", "subcategory": null, "id": 18002464, "is_percent": true, "description": null }] }

Metrics Show

GET /metrics/:id

Example

https://api.onthecity.org/metrics/123455

Required Permissions

Reporting User

Parameters

N/A

Return Data

HTTP 200 OK { "name": "Total of all responses to prayer requests", "category": "Custom", "subcategory": null, "id": 5379098, "is_percent": false, "description": null }

Metrics Create

POST /metrics

Example

https://api.onthecity.org/metrics?name=Baptisms

Required Permissions

Reporting User

Parameters

name = ["string"]

is_percent = [true | false]

subcategory = ["string"]

description = ["string"]

Return Data

HTTP 200 OK { "name": "Baptisms", "category": "Custom", "subcategory": null, "id": 5379098, "is_percent": false, "description": null }

Metrics Update

PUT /metrics/:id

Example

https://api.onthecity.org/metrics/5379098?is_percent=true&name=Baptized&subcategory=Ministry

Notes

You can only update custom metrics.

Required Permissions

Reporting User

Parameters

name = ["string"]

is_percent = [true | false]

subcategory = ["string"]

description = ["string"]

Return Data

HTTP 200 OK { "name": "Baptized", "category": "Custom", "subcategory": "Ministry", "id": 5379098, "is_percent": true, "description": null }

Metrics Destroy

DELETE /metrics/:id

Example

https://api.onthecity.org/metrics/123455

Notes

You can only destroy custom metrics.

Required Permissions

Reporting User

Parameters

N/A

Return Data

HTTP 204 METRIC SUCCESSFULLY DELETED

Metrics Measurements Index

GET /metrics/:metric_id/measurements

Example

https://api.onthecity.org/metrics/12123/measurements

Required Permissions

Reporting User

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 2, "total_pages": 1, "per_page": 20, "current_page": 1, "measurements": [ { "created_at": "05/02/2012 06:22 AM (UTC)", "id": 980190964, "value": 4.0 },{ "created_at": "04/02/2011 06:21 AM (UTC)", "id": 980190963, "value": 5.0 },] }

Metrics Measurements Show

GET /metrics/:metric_id/measurements/:id

Example

https://api.onthecity.org/metrics/123455/measurements/12324234

Required Permissions

Reporting User

Parameters

N/A

Return Data

HTTP 200 OK { "created_at": "05/02/2012 06:22 AM (UTC)", "id": 980190964, "value": 4.0 }

Metrics Measurements Create

POST /metrics/:metric_id/measurements

Example

https://api.onthecity.org/metrics/123/measurements?value=54.75

Notes

You can only create measurements for custom metrics.

Required Permissions

Reporting User

Parameters

value = ["55.0" | 3.23 | 4 | etc]

date = ["2002-05-25" | "10/13/1977"]

time = ["3:00 PM"]

Return Data

HTTP 200 OK { "created_at": "04/02/2011 06:21 AM (UTC)", "id": 980190963, "value": 54.75 }

Metrics Measurements Update

PUT /metrics/:metric_id/measurements/:id

Example

https://api.onthecity.org/metrics/123/measurements/980190964?time=4am&value=55

Notes

You can only update measurements for custom metrics.

Required Permissions

Reporting User

Parameters

value = ["55.0" | 3.23 | 4 | etc]

date = ["2002-05-25" | "10/13/1977"]

time = ["3:00 PM"]
    

Return Data

HTTP 200 OK { "created_at": "05/02/2012 04:00 AM (UTC)", "id": 980190964, "value": 55 }

Metrics Measurements Destroy

DELETE /metrics/:metric_id/measurements/:id

Example

https://api.onthecity.org/metrics/123/measurements/55

Notes

You can only destroy measurements for custom metrics.

Required Permissions

Reporting User

Parameters

N/A

Return Data

HTTP 204 MEASUREMENT SUCCESSFULLY DELETED

Metrics Measurements Last

GET /metrics/:metric_id/measurements/last

Example

https://api.onthecity.org/metrics/123455/measurements/last

Notes

Returns the most recent measurement for this metric.

Required Permissions

Reporting User

Parameters

N/A

Return Data

HTTP 200 OK { "created_at": "05/02/2012 06:22 AM (UTC)", "id": 980190964, "value": 4.0 }

Metrics Measurements Values

GET /metrics/:metric_id/measurements/values

Example

https://api.onthecity.org/metrics/12123/measurements/values

Notes

Returns just the raw values (in order of created_at, oldest to newest) for all the measurements for this metric

Required Permissions

Reporting User

Parameters

N/A

Return Data

HTTP 200 OK { "values": [ 1.11, 44.3, 66.3 ] }

Pledges Index

GET /pledges

Example

https://api.onthecity.org/pledges

Required Permissions

Financial Admin

Parameters

page = [1,2,3,4,...]

campus_id = [12345] <- defaults to all locations

include_participation = [ true | false ] <- defaults to false

Return Data

HTTP 200 OK { "total_entries": 10, "total_pages": 1, "per_page": 20, "current_page": 1, "pledges": [ { "amount"=>"46.00", "created_at": "07/03/2012 12:39 PM (UTC)", "updated_at": "07/03/2012 12:39 PM (UTC)", "fund_id"=>208, "pledge_date"=>"2010-05-30", "id"=>92116, "user_id"=>66188 }, { ... } ] }

Funds Show

GET /funds/:id

Example

https://api.onthecity.org/funds/270670192

Required Permissions

Financial Admin

Parameters

include_participation = [ true | false ] <- defaults to false
    

Return Data

HTTP 200 OK { "amount"=>"46.00", "created_at": "07/03/2012 12:39 PM (UTC)", "updated_at": "07/03/2012 12:39 PM (UTC)", "fund_id"=>208, "pledge_date"=>"2010-05-30", "id"=>92116, "user_id"=>66188 }

Roles Index

GET /roles

Example

https://api.onthecity.org/roles?under_group_id=23456&group_types=CG,Service&titles=Leader

Notes

Use this endpoint to quickly find people based on their role title, group type, and group hierarchy.

For instance, to find all your Small Group leaders and managers at the "West" campus, you would make a call with these parameters:

  • under_group_id: 11223344 (id of "West" campus group)
  • titles: "Leader", "Manager"
  • group_types: "CG"

If you do not pass in the under_group_id parameter, the default is the top-level "church" group, and you will get all the matching roles for groups under, but not including, that group.

Required Permissions

Group Admin

Parameters

page = [1, 2, ...]

under_group_id = [54321]

group_types = ["CG" | "Service" | "Campus" | etc]

titles = ["Leader" | "Manager" | "Volunteer" | "Participant"]
    

Return Data

HTTP 200 OK { "roles": [ { "group_name": "Small Group", "created_at": "06/15/2009", "group_api_url": "https://api.onthecity.org/groups/1933", "title": "Leader", "group_type": "CG", "user_api_url": "https://api.onthecity.org/users/14158", "id": 80245, "user_type": "User", "group_id": 1933, "user_id": 14158, "last_engaged": "03/12/2010", "user_name": "Joe Johnson", "active": true }, { "group_name": "Big Group", "created_at": "06/15/2009", "group_api_url": "https://api.onthecity.org/groups/1933", "title": "Leader", "group_type": "CG", "user_api_url": "https://api.onthecity.org/users/14347", "id": 80302, "user_type": "User", "group_id": 1933, "user_id": 14347, "last_engaged": "09/14/2010", "user_name": "Sally Smith", "active": true }], "total_entries": 4, "total_pages": 1, "per_page": 20, "current_page": 1 }

Skills Index

GET /skills

Example

https://api.onthecity.org/skills

Required Permissions

none

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "skills": [ { "name": "Art-Photography", "created_at": "07/03/2012", "id": 653919100 }, { "name": "Teaching-Adults", "created_at": "07/03/2012", "id": 261727824 }, { "name": "Trade-Electrical", "created_at": "07/03/2012", "id": 407601094 }, { "name": "Trade-Plumbing", "created_at": "07/03/2012", "id": 150233689 }], "total_entries": 4, "total_pages": 1, "per_page": 20, "current_page": 1 }

Skills Show

GET /skills/:id

Example

https://api.onthecity.org/skills/150233689

Notes

You can pass in the ID or the name for the :id parameter

Required Permissions

Account Admin

Parameters

N/A

Return Data

HTTP 200 OK { "name": "Trade-Plumbing", "created_at": "07/03/2012", "id": 150233689 }

Skills Create

POST /skills

Example

https://api.onthecity.org/skills?name=Web-Rails

Required Permissions

Account Admin

Parameters

name = ["Teaching-Children" | etc]

Return Data

HTTP 200 OK { "name": "Teaching-Children", "created_at": "07/03/2012", "id": 857180539 }

Skills Destroy

DELETE /skills/:id

Example

https://api.onthecity.org/skills/Teaching-Adults

Notes

You can pass in the ID or the name for the :id parameter

Required Permissions

Account Admin

Parameters

N/A

Return Data

HTTP 204 Skill Deleted Successfully

Skills | Users Index

GET /skills/:skill_id/users

Example

https://api.onthecity.org/skills/Web-Rails/users

Notes

Returns all the users currently tagged with :skill_id skill. You can pass in the ID or the name for the :skill_id parameter

Required Permissions

User Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "users": [ { "admin_url": "http://church.onthecity.org/admin/users/946060874", "secondary_phone": "", "middle": "", "created_at": "07/03/2012 07:39 PM (UTC)", "External ID 1": null, "secondary_phone_type": "Home", "birthdate": "1974-11-09", "contact_updated_at": "07/18/2012 02:13 PM (UTC)", "External ID 2": null, "title": "Pastor", "last_logged_in": "07/18/2012 09:08 PM (UTC)", "primary_phone_type": "Home", "nickname": "", "updated_at": "07/18/2012 09:13 PM (UTC)", "external_id_1": null, "External ID 3": null, "staff": true, "head_of_household": true, "external_id_2": null, "last": "Shepherd", "internal_url": "http://church.onthecity.org/users/946060874", "id": 946060874, "external_id_3": null, "gender": "Male", "last_engaged": "07/18/2012 09:08 PM (UTC)", "type": "User", "first": "Sam", "primary_campus_name": null, "marital_status": "Never Married", "member_since": "07/03/2012", "email": "email@onthecmail.org", "primary_phone": "", "primary_campus_id": null, "active": true, "email_bouncing": false, "api_url": "https://api.onthecity.org/users/946060874" }], "total_entries": 1, "total_pages": 1, "per_page": 20, "current_page": 1 }

Skills | Users User_Ids

GET /skills/:skill_id/user_ids

Example

https://api.onthecity.org/skills/Web-Rails/user_ids

Notes

Returns all the ids of the users currently tagged with :skill_id skill. You can pass in the ID or the name for the :skill_id parameter

Required Permissions

User Admin

Parameters

N/A

Return Data

HTTP 200 OK { "user_ids": [ 946060874, 946060875 ] }

Skills | Users Count

GET /skills/:skill_id/users/count

Example

https://api.onthecity.org/skills/Web-Rails/users/count

Notes

Returns the count of active users currently tagged with :skill_id skill. You can pass in the ID or the name for the :skill_id parameter

Required Permissions

User Admin

Parameters

N/A

Return Data

{ "count": 4 }

Tags Index

GET /tags

Example

https://api.onthecity.org/tags

Required Permissions

none

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "tags": [ { "name": "Evening", "created_at": "07/03/2012", "id": 17166901 }, { "name": "Friday", "created_at": "07/03/2012", "id": 857180536 }, { "name": "Kid-Friendly", "created_at": "07/03/2012", "id": 1014391207 }], "total_entries": 3, "total_pages": 1, "per_page": 20, "current_page": 1 }

Tags Show

GET /tags/:id

Example

https://api.onthecity.org/tags/Friday

Notes

You can pass in the ID or the name for the :id parameter

Required Permissions

Account Admin

Parameters

N/A

Return Data

HTTP 200 OK { "name": "Friday", "created_at": "07/03/2012", "id": 857180536 }

Tags Create

POST /tags

Example

https://api.onthecity.org/tags?name=Singles

Required Permissions

Account Admin

Parameters

name = ["Singles" | etc]

Return Data

HTTP 200 OK { "name": "Singles", "created_at": "07/03/2012", "id": 857180537 }

Tags Update

PUT /tags/:id

Example

https://api.onthecity.org/tags/Singles?name=Singles-Men

Required Permissions

Account Admin

Parameters

name = ["Singles" | etc]

Return Data

HTTP 200 OK { "name": "Singles-Men", "created_at": "07/03/2012", "id": 857180537 }

Tags Destroy

DELETE /tags/:id

Example

https://api.onthecity.org/tags/Friday

Notes

You can pass in the ID or the name for the :id parameter

Required Permissions

Account Admin

Parameters

N/A

Return Data

HTTP 204 Tag Deleted Successfully

Tags Groups Index

GET /tags/:tag_id/groups

Example

https://api.onthecity.org/tags/17166901/groups

Notes

Returns all the groups currently tagged with :tag_id tag. You can pass in the ID or the name for the :tag_id parameter

Required Permissions

Group Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "groups": [ { "name": "Johns Community Group", "admin_url": "http://church.onthecity.org/admin/groups/839047027", "created_at": "2012-07-03T12:39:34Z", "started_as_seed": false, "nickname": "", "internal_url": "http://church.onthecity.org/groups/839047027", "group_type": "Community", "id": 839047027, "plaza_url": "http://church.onthecity.org/plaza?group_id=839047027", "smart_large_profile_pic": "https://church.onthecity.org/images/default_group_large.jpg", "parent_id": 885124098, "external_description": "CG for John", "api_url": "https://api.onthecity.org/groups/839047027" }, {...} ], "total_entries": 2, "total_pages": 1, "per_page": 20, "current_page": 1 }

Terminology Index

GET /terminology

Example

https://api.onthecity.org/terminology

Required Permissions

Account Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "labels": [ { "CG": "Community" }, { "Service": "Service" }, { "Campus": "Campus" }, { "Church": "Church" }, { "Network": "Network" }, { "Neighborhood": "Neighborhood" }, { "Redemption": "Redemption" }, { "Staff": "Staff" }, { "Huddle": "Leader" }, { "Band": "Band" }, { "Member": "Member" }, { "Welcome": "Connect" }, { "Other": "Other" }, { "Seed": "Seed" }, { "Pledge": "Pledge" }, { "external_id_1": "External ID 1" }, { "external_id_2": "External ID 2" }, { "external_id_3": "External ID 3" } ] }

Terminology Show

GET /terminology/:native_label

Example

https://api.onthecity.org/terminology/CG

Required Permissions

Account Admin

Parameters

N/A

Return Data

HTTP 200 OK { "CG": "Community" }

Terminology Update

PUT /terminology/:native_label

Example

https://api.onthecity.org/terminology/CG?label=Life

Required Permissions

Account Admin

Parameters

label = [ "Life" | etc]

Return Data

HTTP 200 OK { "CG": "Life" }

WebHooks Index

GET /webhooks

Example

https://api.onthecity.org/webhooks

Required Permissions

API Admin

Parameters

page = [1, 2, ...]

Return Data

HTTP 200 OK { "total_entries": 1, "total_pages": 1, "web_hooks": [ { "callback_uri": "https://mysite.com/user_create", "id": 1, "event": "create", "object": "User" }], "per_page": 20, "current_page": 1 }

WebHooks Create

POST /webhooks

Example

https://api.onthecity.org/webhooks
{
  "callback_uri":"https://mysite.com/city_user_create",
  "object":"User",
  "event":"Create"
}

Required Permissions

API Admin

Parameters

callback_uri = ["https://valid.sslurl.com"]

object = ["User" | "Group" | "Invitation" | "Privilege" | "Checkin" | "Address"]

event = ["create" | "update" | "destroy" | "expire"]

Return Data

HTTP 200 OK { "callback_uri": "https://mysite.com/user_create", "id": 1, "event": "create", "object": "User" }

WebHooks Destroy

DELETE /webhooks/:id

Example

https://api.onthecity.org/webhooks/2

Required Permissions

API Admin

Parameters

N/A

Return Data

HTTP 204 Webhook Deleted Successfully

WebHook Events Index

GET /webhooks/events

Example

https://api.onthecity.org/webhooks/events?status=unstarted,pending,fail&object_type=User

Notes

Allows you to retrieve the events that fired webhook callbacks. You can combine filters to retrieve just the events you care about.

  • webhook_status: the overall status of the callbacks.
  • id: the id of this particular webhook event.
  • event: the name of the webhook event.
  • object_id: the id of the object.
  • object_type: the type of the object, i.e. 'User', 'Address', etc.
  • webhooks: the callbacks to your registerd URLs.

Required Permissions

API Admin

Parameters

page = [1, 2, ...]
per_page = [ 1, ... , 100 ]
status = [ "unstarted", "pending", "fail", "success", "pending,fail", etc]
event = [ "user.create", "address.update", etc ]
start = [ 12344566 ] <- epoch timestamp to search "after"
end = [ 12344566 ] <- epoch timestamp to search "before"
object_type = [ "User", "Group", etc ]
event_type = [ "update", "create", etc ]
object_id = [ 123456, ... ]
    

Return Data

HTTP 200 OK { "per_page": 20, "current_page": 1, "total_entries": 7, "total_pages": 1, "events": [ { "created_at": 1391465180, "id": "19da64f483afec129b87e232056ee5995bb9355a", "webhook_status": "success", "event": "user.update", "object_id": 686913, "object_type": "User", "object": { "webhook_id": "19da64f483afec129b87e232056ee5995bb9355a", "webhook_timestamp": 1391465180, "webhook_event": "update", "webhook_event_occurred_at": "Mon, 03 Feb 2014 22:06:20 +0000", "webhook_object": "User", "id": 686913, "type": "User", "first": "Dave", "last": "Andersen", "changed": { "first": [ "David", "Dave" ] }, ... }, "webhooks": [ { "uri": "https://yoursite.com/user/update", "retry_count": 0, "id": 246, "status": "success" } ] }, { ... } ] }

WebHook Events Show

GET /webhooks/events/:id

Example

https://api.onthecity.org/webhooks/events/19da64f483afec129b87e232056ee5995bb9355a

Notes

Allows you to retrieve a specific webhook event.

  • webhook_status: the overall status of the callbacks.
  • id: the id of this particular webhook event.
  • event: the name of the webhook event.
  • object_id: the id of the object.
  • object_type: the type of the object, i.e. 'User', 'Address', etc.
  • webhooks: the callbacks to your registerd URLs.

Required Permissions

API Admin

Parameters

N/A

Return Data

HTTP 200 OK { "created_at": 1391465180, "id": "19da64f483afec129b87e232056ee5995bb9355a", "webhook_status": "success", "event": "user.update", "object_id": 686913, "object_type": "User", "object": { "webhook_id": "19da64f483afec129b87e232056ee5995bb9355a", "webhook_timestamp": 1391465180, "webhook_event": "update", "webhook_event_occurred_at": "Mon, 03 Feb 2014 22:06:20 +0000", "webhook_object": "User", "id": 686913, "type": "User", "first": "Dave", "last": "Andersen", "changed": { "first": [ "David", "Dave" ] }, ... }, "webhooks": [ { "uri": "https://yoursite.com/user/update", "retry_count": 0, "id": 246, "status": "success" } ] }