The City Webhooks v.1.0

Introduction

Webhooks allow your app or website to listen for specific events that take place on The City, and to then be notified in the form of JSON data when that specific event occurs. For instance, if you register to listen for "Users#update" events, we will POST the change to your site when a user updates their profile data (say, their phone number) on The City.

When combined with the Admin API, webhooks allow developers to build powerful apps on The City platform without having to needlessly poll for changes to data they care about.

Configuring Webhooks

There are just a few simple configuration steps required to allow your app to take advantage of webhooks on The City.

1. First, register a URL with The City

2. Next, setup a server to receive and respond to the webhook

3. Finally, wait for an event to occur

Registration

Tell The City what URI you want data posted to

To create a new webhook URI registration, you must first have (or grant yourself) 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 manage webhook registrations for that City instance.

Go to Admin > API > Webhooks. Click "+ Create New Webhook", and associate a URI with a specific object and event. Now, whenever that event occurs, The City will send an HTTP POST to that address with appropriate data for the object that fired the event.

Create New Webhook

Callback URI - This is the web address that The City will POST data to. SSL endpoint required.

Object - The type of object in The City you are interested in.

The different objects available in this version:

  • Users - The User object is used for both offline users and online users.
  • Groups - The heart of The City, users belong to Groups.
  • Addresses - Locations that belong to a user or group are called Addresses in The City.
  • Invitations - Invitations are the objects used both for external invitations to The City, and internal invitations to join a group.
  • Privileges - Admin Privileges are the different administrative security roles an Account Admin can assign to other users in The City (User Admin, Designer, Group Admin, etc).
  • Checkins - If your City uses the Children's Ministry module, you can listen for events related to Checkins.

Event - The action that occurs in The City that will fire a webhook.

The different events available in this version (not all are applicable to every object):

  • create - When a new object is saved to the database.
  • update - When an object is updated and has changed attributes.
  • destroy - Certain objects can be deleted in The City, which will trigger a destroy webhook.
  • expire - An invitation expires if the invitee fails to respond in a timely manner.
  • check_out - Checkins have a check_out action that fires when a child is checked out of a classroom.

You can register the same URI for any Object#event you want to listen for (they do not have to be unique). Also, you can register as many webhooks as you need to for the same Object#event.

Receiving a Webhook

Configure your server to receive JSON data

When a webhook fires in The City, it is your server that will be receiving the data. All you need is a simple server that can parse JSON data, and then do something with that data (store it in a local database, kick off a workflow, etc).

The webhook will be sent as a POST request, with the data in the request body. The data includes information regarding the object and event that fired, as well as the JSON representation of the object that fired the webhook.

In order for you to know that the request came from The City, we pass along a signature in the headers:

  • X-City-Webhook-Signature - Can be found on The City at Admin > API > Webhooks

Webhook signature

Responding to a Webhook

Let The City know you got the post

When The City sends data to the registered URI, it is expecting a simple HTTP 200 OK response to acknowledge you received the POST successfully. Anything besides a status code 200 is considered a failed attempt.

Upon failure, The City will retry posting the data using an exponential backoff strategy. The subsequent retries follow this delay pattern:

  • 60 seconds
  • 10 minutes
  • 1 hour
  • 3 hours
  • 6 hours

After the sixth and final attempt (approx. 10 hours + 11 minutes from the first failed attempt), The City gives up, and does not retry that webhook.

 

Webhook Events

Each event that results in a webhook is logged and stored as a Webhook Event which you can query using Admin API endpoints.

This allows you external application to go back and "replay" webhooks you receive during a specific timeframe, or to clean up webhooks that resulted in a failure, or perhaps just to help debug while building your app.

Every webhook JSON payload you receive will include the following webhook related fields, which you can use to track down and filter webhook events:

  • webhook_id - This is the ID of the webhook event.
  • webhook_timestamp - The epoch timestamp that the webhook event occured.
  • webhook_object - The object type that triggered the webhook event, i.e. 'User' or 'Group'.
  • webhook_event - The event type that triggered the webhook event, i.e. 'create' or 'update'.

Available Webhooks

Addresses#create

Notes

Returns the JSON representation of an Address whenever a new addresses is created for a group or user.

Triggers

Fires whenever a new Address is created that belongs to a user or group.

Post Data

Address that belongs to a group: { "webhook_object":"Address", "webhook_event":"create", "city":"Seattle", "created_at":"08/08/2012 09:17 PM (UTC)", "latitude":47.663667, "zipcode":"", "updated_at":"08/09/2012 06:33 AM (UTC)", "street2":"", "group_id":839047027, "id":65067329, "street":"1203 NW Leary way", "group_external_id":null, "location_type":"Host", "longitude":-122.3735, "privacy":"Public", "state":"WA" } Address that belongs to a user: { "webhook_object":"Address", "webhook_event":"create", "city":"Seattle", "created_at":"08/08/2012 09:17 PM (UTC)", "latitude":47.641133, "zipcode":"98109", "updated_at":"08/09/2012 06:29 AM (UTC)", "street2":"", "id":552561485, "street":"2547 32nd Ave West", "user_id":946060874, "location_type":"Home", "user_external_id_1":"", "user_external_chms_id":"", "longitude":-122.39831, "privacy":"Private", "state":"WA" }

Addresses#update

Notes

Returns the JSON representation of an Address whenever an address is updated.

Triggers

Fires whenever any of the following attributes on an address are changed:

"street", 
"street2", 
"city", 
"state", 
"latitude", 
"longitude",
"location_type", 
"privacy_setting", 
"zipcode"

Locations on The City can be updated by:
  Admin
  Group Leaders
  Users
  Admin API

Post Data

Address that belongs to a group: { "webhook_object":"Address", "webhook_event":"update", "changed":{ "latitude":[47.643793,47.6411333], "zipcode":[null,"98109"], "street":["2547 32nd Ave W","2547 32nd Ave West"], "longitude":[-122.396937,-122.3983095] }, "city":"Seattle", "created_at":"08/08/2012 09:17 PM (UTC)", "latitude":47.641133, "zipcode":"98109", "updated_at":"08/09/2012 06:29 AM (UTC)", "street2":"", "id":552561485, "street":"2547 32nd Ave West", "group_id":839047027, "location_type":"Host", "group_external_id":null, "longitude":-122.39831, "privacy":"Private", "state":"WA" } Address that belongs to a user: { "object":"Address", "event":"update", "changed":{ "latitude":[47.643793,47.6411333], "zipcode":[null,"98109"], "street2":[null,"Suite 2"], "street":["2547 32nd Ave W","2547 32nd Ave West"], "longitude":[-122.396937,-122.3983095] }, "city":"Seattle", "created_at":"08/08/2012 09:17 PM (UTC)", "latitude":47.641133, "zipcode":"98109", "updated_at":"08/09/2012 06:29 AM (UTC)", "street2":"Suite 2", "id":552561485, "street":"2547 32nd Ave West", "user_id":946060874, "location_type":"Home", "user_external_id_1":"", "user_external_chms_id":"", "longitude":-122.39831, "privacy":"Private", "state":"WA" }

Addresses#destroy

Notes

Returns a stripped down JSON representation of an Address that was deleted.

Triggers

Fires when an Address is successfuly destroyed.

Post Data

{ "webhook_object":"Address", "webhook_event":"destroy", "id":552561485, "group_id":null, "user_id":946060874 }

Checkins#create

Notes

Returns the JSON representation of a Checkin whenever a child successfully checks into The City Children's Ministry.

Triggers

Fires whenever a new Checkin is created. A Checkin object is created for each child that is checked in, and includes data about the group and event they are checked into, as well as who checked them in.

Post Data

{ "webhook_object":"Checkin", "webhook_event":"create", "group":{ "name":"First Grade", "external_id":nil, "id":1023606148 }, "checked_out_by_user":null, "callboard_number":"106", "parent_group_name":"Ballard Childrens ministry", "special_instructions":"", "checked_in_at":"09/27/2012 08:40 PM (UTC)", "checked_in_user":"Tommy Boy", "checked_in_user_id":1068169464, "barcode":"4F02523945", "id":853371869, "parent_receipt_barcode":"313C04B71D1", "checked_in_by_user":"Tom Leaderman", "event":{ "ending_at":"09/27/2012 05:30 PM (UTC)", "title":"9 AM Service", "id":421789077, "starting_at":"09/27/2012 04:00 PM (UTC)" }, "checked_in_user_notes":"", "checked_out_at":null, "pager_number":44333, "parent_group_id":49861013, "checked_in_by_user_id":1038054164 }

Checkins#check_out

Notes

Returns the JSON representation of a Checkin whenever a child is successfully checked out of The City Children's Ministry.

Triggers

Fires whenever a child checks out of Children's Ministry.

Post Data

{ "webhook_object":"Checkin", "webhook_event":"check_out", "changed":{ "checked_out_by_user_id":[nil, 1038054164], "checked_out_at":[nil, "2012-09-27T13:41:16-07:00"] } "group":{ "name":"First Grade", "external_id":nil, "id":1023606148 }, "checked_out_by_user":"Tom Leaderman", "callboard_number":"106", "parent_group_name":"Ballard Childrens ministry", "special_instructions":"", "checked_in_at":"09/27/2012 08:40 PM (UTC)", "checked_in_user":"Tommy Boy", "checked_in_user_id":1068169464, "barcode":"4F02523945", "id":853371869, "parent_receipt_barcode":"313C04B71D1", "checked_in_by_user":"Tom Leaderman", "event":{ "ending_at":"09/27/2012 05:30 PM (UTC)", "title":"9 AM Service", "id":421789077, "starting_at":"09/27/2012 04:00 PM (UTC)" }, "checked_in_user_notes":"", "checked_out_at":"09/27/2012 08:41 PM (UTC)", "pager_number":44333, "parent_group_id":49861013, "checked_in_by_user_id":1038054164, }

Duplicates#create

Notes

Returns the JSON representation of an Duplicate, which points at two users flagged as potential duplicates.

Triggers

Fires whenever a new duplicate user is detected, and matches the criteria in the 'parameters' field.

You will receive one webhook for each match, so if a new user (e.g. "Sam") gets created that matches two other users (e.g. "Sammy" and "Samson"), you will receive two webhooks: One for the "Sam" and "Sammy" match, and one for the "Sam" and "Samson" match.

Post Data

{ "webhook_event_occurred_at" : "Tue, 16 Apr 2013 22:42:38 +0000", "webhook_event" : "create", "webhook_object" : "Duplicate", "parameters" : "first, last", "false_positive" : false, "id" : 6, "right_user" : { "email" : "", "email_bouncing" : false, "active" : true, "api_url" : "https://api.onthecity.org/users/1068169466", "member_since" : null, "primary_phone" : "", "primary_campus_id" : null, "external_chms_id" : null, "primary_campus_name" : null, "first" : "Sam", "last_engaged" : null, "type" : "OfflineUser", "id" : 1068169466, "external_id_3" : null, "gender" : "Male", "external_id_2" : null, "last" : "Shepherd", "head_of_household" : true, "internal_url" : "", "staff" : null, "updated_at" : "04/16/2013 10:42 PM (UTC)", "last_logged_in" : null, "nickname" : "", "external_id_1" : null, "External ID 3" : null, "primary_phone_type" : "Home", "checkin_info" : null, "contact_updated_at" : null, "secondary_phone_type" : "Home", "title" : null, "birthdate" : null, "External ID 2" : null, "secondary_phone" : "", "created_at" : "04/16/2013 10:42 PM (UTC)", "middle" : "", "External ID 1" : null, "admin_url" : "https://church.onthecity.org/admin/users/1068169466" }, "left_user" : { "email" : "", "email_bouncing" : false, "active" : true, "api_url" : "https://api.onthecity.org/users/1068169465", "member_since" : null, "primary_phone" : "", "primary_campus_id" : null, "external_chms_id" : null, "primary_campus_name" : null, "first" : "Sam", "last_engaged" : null, "type" : "OfflineUser", "id" : 1068169465, "external_id_3" : null, "gender" : "Male", "external_id_2" : null, "last" : "Shepherd", "head_of_household" : true, "internal_url" : "", "staff" : null, "updated_at" : "04/16/2013 10:27 PM (UTC)", "last_logged_in" : null, "nickname" : "", "external_id_1" : null, "External ID 3" : null, "primary_phone_type" : "Home", "checkin_info" : null, "contact_updated_at" : null, "secondary_phone_type" : "Home", "title" : null, "birthdate" : null, "External ID 2" : null, "secondary_phone" : "", "created_at" : "04/16/2013 10:27 PM (UTC)", "middle" : "", "External ID 1" : null, "admin_url" : "https://church.onthecity.org/admin/users/1068169465" } }

Duplicates#merge

Notes

Returns the JSON representation of an Duplicate, which points at two users flagged as potential duplicates.

Triggers

Fires whenever two users that were flagged as potential duplicates are successfully merged.

Post Data

{ "webhook_object" : "Duplicate", "id" : 7, "parameters" : "first, last", "webhook_event_occurred_at" : "Wed, 17 Apr 2013 20:08:58 +0000", "false_positive" : false, "webhook_event" : "merge", "merged_user" : { "primary_campus_id" : null, "api_url" : "https://api.onthecity.org/users/946060874", "primary_phone" : null, "email_bouncing" : false, "member_since" : "03/21/2013", "email" : "zack@onthecity.org", "active" : true, "external_chms_id" : null, "primary_campus_name" : null, "first" : "Sam", "last_engaged" : "04/17/2013 08:04 PM (UTC)", "type" : "User", "id" : 946060874, "external_id_3" : null, "gender" : "Male", "head_of_household" : true, "staff" : true, "external_id_2" : null, "last" : "Shepherd", "internal_url" : "https://church.onthecity.org/users/946060874", "updated_at" : "03/22/2013 07:55 PM (UTC)", "nickname" : null, "last_logged_in" : "04/17/2013 08:04 PM (UTC)", "external_id_1" : "pastorfoobar", "External ID 3" : null, "primary_phone_type" : "Home", "checkin_info" : null, "secondary_phone_type" : "Home", "birthdate" : "1974-11-09", "contact_updated_at" : null, "External ID 2" : null, "title" : "Pastor", "middle" : null, "secondary_phone" : null, "External ID 1" : "pastorfoobar", "created_at" : "03/22/2013 07:55 PM (UTC)", "admin_url" : "https://church.onthecity.org/admin/users/946060874" }, "deleted_user" : { "primary_campus_id" : null, "api_url" : "https://api.onthecity.org/users/1068169467", "primary_phone" : "", "email_bouncing" : false, "member_since" : null, "email" : "", "active" : true, "external_chms_id" : null, "primary_campus_name" : null, "first" : "Sam", "last_engaged" : null, "type" : "OfflineUser", "id" : 1068169467, "external_id_3" : null, "gender" : "Male", "head_of_household" : true, "staff" : null, "external_id_2" : null, "last" : "Shepherd", "internal_url" : "", "updated_at" : "04/17/2013 08:08 PM (UTC)", "nickname" : "", "last_logged_in" : null, "external_id_1" : null, "External ID 3" : null, "primary_phone_type" : "Home", "checkin_info" : null, "secondary_phone_type" : "Home", "birthdate" : null, "contact_updated_at" : null, "External ID 2" : null, "title" : null, "middle" : "", "secondary_phone" : "", "External ID 1" : null, "created_at" : "04/17/2013 08:08 PM (UTC)", "admin_url" : "https://church.onthecity.org/admin/users/1068169467" } }

Groups#create

Notes

Returns the JSON representation of a Group whenever a new group is created.

Triggers

Fires whenever a new groups is created. Groups are created via:
  Admin
  Seed Groups (if featured enabled)
  Admin API

Post Data

{ "webhook_object": "Group", "webhook_event": "create", "name": "Johns Community Group", "admin_url": "https://church.onthecity.org/admin/groups/839047027", "created_at": "09/25/2012 12:01 PM (UTC)", "started_as_seed": false, "profile_pic": "https://local.devthecity.org/images/default_group_large.jpg", "campus_name": "Ballard", "nearest_neighborhood_id": 631103380, "nickname":nil, "updated_at": "09/27/2012 07:09 PM (UTC)", "internal_url": "https://church.onthecity.org/groups/839047027", "group_type":"Community", "unlisted":false, "external_id":"", "inactive":false, "target_size":1, "id":839047027, "secure":false, "nearest_neighborhood_name":"The Hood", "default_invitation_custom_message":"", "plaza_url":"https://church.onthecity.org/plaza?group_id=839047027", "last_engaged":nil, "campus_id":823956377, "archive_scheduled":false, "parent_id":885124098, "time_zone":"", "api_url":"https://api.onthecity.org/groups/839047027", "auto_approve_invites":false, "deletion_scheduled":false, "external_description":"CG for John's group" }

Groups#update

Notes

Returns the JSON representation of a Group whenever a group is updated.

Triggers

Fires whenever any of the following attributes on a groups's record are changed:

"name", 
"parent_id", 
"ancestry", 
"group_type",
"external_description", 
"target_size", 
"secure", 
"unlisted", 
"deletion_scheduled",
"nickname", 
"archive_scheduled", 
"inactive",
"external_id",
"time_zone"


Post Data

{ "webhook_object":"Group", "webhook_event":"update", "changed":{ "secure":[false, true] }, "name":"Johns Community Group", "admin_url":"https://church.onthecity.org/admin/groups/839047027", "created_at":"09/25/2012 12:01 PM (UTC)", "started_as_seed":false, "profile_pic":"https://local.devthecity.org/images/default_group_large.jpg", "campus_name":"Ballard", "nearest_neighborhood_id": 631103380, "nickname":nil, "updated_at":"09/27/2012 07:09 PM (UTC)", "internal_url":"https://church.onthecity.org/groups/839047027", "group_type":"Community", "unlisted":false, "external_id":"", "inactive":false, "target_size":1, "id":839047027, "secure":true, "nearest_neighborhood_name":"The Hood", "default_invitation_custom_message":"", "plaza_url":"https://church.onthecity.org/plaza?group_id=839047027", "last_engaged":nil, "campus_id":823956377, "archive_scheduled":false, "parent_id":885124098, "time_zone":"", "api_url":"https://api.onthecity.org/groups/839047027", "auto_approve_invites":false, "deletion_scheduled":false, "external_description":"CG for John's group" }

GroupTags#create

Notes

Returns the JSON representation of an Group Tag, which is a available for a group leader or group admin to tag a group with.

Triggers

Fires whenever an Account Admin has created a new tag for use by Group Admins or group leaders to use to tag their groups. Group Tags are managed under Admin | Site Settings | Group Tags.

Post Data

{ "webhook_object" : "GroupTag", "id" : 1071032985, "webhook_event_occurred_at" : "Wed, 17 Apr 2013 20:46:53 +0000", "created_at" : "04/17/2013", "name" : "Bible Study", "webhook_event" : "create" }

GroupTags#update

Notes

Returns the JSON representation of an Group Tag, which is a available for a group leader or group admin to tag a group with.

Triggers

Fires whenever an Account Admin has updated the name of a tag. Group Tags are managed under Admin | Site Settings | Group Tags.

Post Data

{ "webhook_object" : "GroupTag", "id" : 1071032985, "webhook_event_occurred_at" : "Wed, 17 Apr 2013 20:46:53 +0000", "created_at" : "04/17/2013", "name" : "Bible", "webhook_event" : "update" }

GroupTags#destroy

Notes

Returns the JSON representation of an Group Tag, which is a available for a group leader or group admin to tag a group with.

Triggers

Fires whenever an Account Admin has deleted a tag. Group Tags are managed under Admin | Site Settings | Group Tags.

Post Data

{ "webhook_object" : "GroupTag", "id" : 1071032985, "webhook_event_occurred_at" : "Wed, 17 Apr 2013 20:46:53 +0000", "name" : "Bible", "webhook_event" : "destroy" }

Invitations#expire

Notes

Returns the JSON representation of an Invitation whenever an invitation expires.

Triggers

Fires whenever an invitation expires, which means it is 4 weeks old without being accepted.

Post Data

{ "webhook_object":"Invitation", "webhook_event":"expire", "leader_approved":true, "external_id_1":null, "external_id_2":null, "id":764636012, "group_id":823956377, "external_id_3":null, "user_id":null, "source":"Invited by individual | Pastor Sam Shepherd (946060874) to Ballard (823956377) on 2012-08-08 at 22:33", "member_since":null, "email":"eee@wewe.biz" }

Privileges#create

Notes

Returns the JSON representation of an Admin Privilege whenever a new admin role is created.

Triggers

Fires whenever a Admin Privilege is created. Privileges are assigned via:
  Account Admin

Post Data

{ "webhook_object":"Privilege", "webhook_event":"create", "created_at":"2012-08-08T23:35:05-07:00", "title":"Financial User", "sub_role":"Admin User", "group_id":null, "user_id":23838500 }

Privileges#destroy

Notes

Returns the JSON representation of an Admin Privilege whenever an admin role is deleted.

Triggers

Fires whenever a Admin Privilege is destroyed. Privileges are assigned via:
  Account Admin

Post Data

{ "webhook_object":"Privilege", "webhook_event":"destroy", "created_at":"2012-08-08T23:35:05-07:00", "title":"Designer", "sub_role":null, "group_id":null, "user_id":23838500 }

Roles#create

Notes

Returns the JSON representation of a group Role.

Triggers

Fires whenever a new group Role is created. Roles are created via:
  Accepting an Invitation
  Admin adding Offline User's to a group
  Children's Ministry module
  Admin API

Post Data

{ "webhook_object": "Role", "webhook_event": "create", "webhook_timestamp": 1391111866, "webhook_event_occurred_at": "Thu, 30 Jan 2014 19:57:46 +0000", "webhook_id": "b3be6bbc4de3c46c6ce79ebe5ffc736fa1955ad6", "id": 1073705279, "active": true, "user_name": "Jan Leaderman", "last_engaged": null, "user_id": 753762654, "group_id": 839047027, "user_type": "User", "user_api_url": "https://api.onthecity.org/users/753762654", "group_type": null, "title": "Participant", "created_at": "01/30/2014 07:57 PM (UTC)", "group_api_url": "https://api.onthecity.org/groups/839047027", "group_name": "Johns Community Group", }

Roles#update

Notes

Returns the JSON representation of a group Role.

Triggers

Fires whenever a new group Role is updated. Roles are updated via:
  Leader demotes/promotes a user's Role in a group
  Admin API

Post Data

{ "webhook_object": "Role", "webhook_event": "update", "webhook_timestamp": 1391108579, "webhook_event_occurred_at": "Thu, 30 Jan 2014 19:02:59 +0000", "webhook_id": "67b2e34d7eac2b2cd8eb18d1d4824f0eb86ed3b0", "id": 906460386, "changed": { "title": [ "Manager", "Volunteer" ] }, "active": true, "user_name": "Jim Groupie", "last_engaged": null, "user_id": 1027431151, "group_id": 839047027, "user_type": "User", "user_api_url": "https://api.onthecity.org/users/1027431151", "group_type": "Community", "title": "Manager", "created_at": "01/17/2014 12:09 AM (UTC)", "group_api_url": "https://api.onthecity.org/groups/839047027", "group_name": "Johns Community Group" }

Roles#destroy

Notes

Returns the JSON representation of a group Role.

Triggers

Fires whenever a new group Role is destroyed. Roles are destroyed via:
  Leader removes a user's Role in a group.
  User leaves a group on their own.
  When a group is destroyed.
  Admin API.

Post Data

{ "webhook_id": "8939ca0217dbb68449d19c322bf79633fe57c2eb", "id": 699278563, "webhook_timestamp": 1391111775, "webhook_object": "Role", "webhook_event_occurred_at": "Thu, 30 Jan 2014 19:56:15 +0000", "webhook_event": "destroy" }

Users#create

Notes

Returns the JSON representation of a User whenever a new user is created.

Triggers

Fires whenever a new User or OfflineUser is created. Users are created via:
  Invitation
  Users adding spouse/children to The City
  Admin
  Children's Ministry module
  Bulk Import
  Admin API

Post Data

{ "webhook_object":"User", "webhook_event":"create", "admin_url":"https://church.onthecity.org/admin/users/1068169465", "created_at":"08/09/2012 06:25 AM (UTC)", "External ID 1":null, "secondary_phone":"4254151988", "middle":"Blake", "contact_updated_at":"08/08/2012 11:25 PM (UTC)", "title":null, "birthdate":"1977-10-13", "secondary_phone_type":"Mobile", "External ID 2":null, "primary_phone_type":"Home", "last_logged_in":null, "external_id_1":null, "External ID 3":null, "Baptism Date":null, "nickname":"Joey", "updated_at":"08/09/2012 06:25 AM (UTC)", "head_of_household":true, "internal_url":"", "external_id_2":null, "staff":null, "last":"Smith", "id":1068169465, "gender":"Male", "external_id_3":null, "last_engaged":null, "type":"OfflineUser", "first":"Joe", "MyString":null, "Hot Drink Choice":null, "primary_campus_name":null, "external_chms_id":null, "marital_status":null, "is_an_organization":false, "email":"joe@noemail.com", "api_url":"https://api.onthecity.org/users/1068169465", "primary_phone":"4254151988", "active":true, "primary_campus_id":null, "member_since":"04/01/2000", "email_bouncing":false }

Users#update

Notes

Returns the JSON representation of a User whenever a user is updated.

Triggers

Fires whenever any of the following attributes on a user's record are changed:

"first",
"middle",
"last",
"nickname",
"email",
"primary_phone",
"secondary_phone", 
"primary_phone_type", 
"secondary_phone_type", 
"optional_primary_campus_id",
"gender", 
"inactive", 
"birthdate", 
"member_since",
"staff", 
"email_bounced", 
"external_id_1", 
"external_id_2", 
"external_id_3",
"contact_updated_at", 
"checkin_info", 
"external_chms_id",
"marital_status",
"type"

Also:
  Custom Fields

Post Data

{ "webhook_object":"User", "webhook_event":"update", "changed":{ "middle":[null,"James"], "external_id_2":[null,"5678"], "external_id_3":[null,"6789"], "optional_primary_campus_id":[null,823956377] }, "admin_url":"https://church.onthecity.org/admin/users/946060874", "created_at":"08/08/2012 09:17 PM (UTC)", "External ID 1":"", "secondary_phone":null, "middle":"James", "contact_updated_at":"08/08/2012 11:27 PM (UTC)", "title":"Pastor", "birthdate":"1974-11-09", "secondary_phone_type":null, "External ID 2":"", "primary_phone_type":null, "last_logged_in":"08/09/2012 06:20 AM (UTC)", "external_id_1":"", "External ID 3":"", "Baptism Date":null, "nickname":null, "updated_at":"08/09/2012 06:27 AM (UTC)", "head_of_household":true, "internal_url":"https://church.onthecity.org/users/946060874", "external_id_2":"", "staff":true, "last":"Shepherd", "id":946060874, "gender":"Male", "external_id_3":"", "last_engaged":"08/09/2012 06:20 AM (UTC)", "type":"User", "first":"Sam", "MyString":null, "Hot Drink Choice":null, "primary_campus_name":"Ballard", "external_chms_id":null, "marital_status":"Married", "is_an_organization":false, "email":"zack@onthecity.org", "api_url":"https://api.onthecity.org/users/946060874", "primary_phone":null, "active":true, "primary_campus_id":823956377, "member_since":"08/08/2012", "email_bouncing":false }

Users#destroy

Notes

Returns a stripped down JSON representation of a User that was deleted. In The City, only OfflineUsers can be deleted.

Triggers

Fires when an OfflineUser is successfuly destroyed.

Post Data

{ "webhook_object":"User", "webhook_event":"destroy", "family_id":null, "external_id_1":null, "last":"Dupe", "id":368320, "first":"Timmy", "external_chms_id":null, "email":null }