Skip to content

Get Contact

corsacca edited this page Mar 19, 2019 · 5 revisions

GET https://example.com/wp-json/dt/v1/contact/{contact_id}/

Replace example.com with your domain Replace {contact_id} with the ID of the contact.

Parameters

  • none

Returns

(json object): the contact. Each field type will show in a different way:

  • "ID"
  • "title":"Jonh Doe",
  • "created_date":"2018-06-05 16:07:16",
  • "last_modified":"1552987784", //date the contact has last been modifield
  • text fields
"field_key": "text"
  • multi_select fields
"field_key": [ 
    "option_key", 
    "option_key",
    ... 
]
  • key_select fields
"field_key": {
   "key":"option_key",
   "label":"option_label"
},
  • connection fields
"field_key": [ 
   { 
       "ID":{post_id},
       "post_type":"{post_type}",
       "post_date_gmt":"2018-05-29 13:12:01",
       "post_date":"2018-05-29 13:12:01",
       "post_title":"{post_title}"
   },
   ...
]
  • date fields
"field_key": {
    timestamp: "1552953600",  //unix timestamp and the date
    formatted: "March 19, 2019" // date formatted base on selected date format in WP settings
}

Return Example

{
"ID":72,
"title":"Mojiz Chra\u00efbi",
"created_date":"2018-06-05 16:07:16",
"last_modified":"1552987784",
"locations":[
    {"ID":21,"post_type":"locations","post_date_gmt":"2018-05-29 13:12:01","post_date":"2018-05-29 13:12:01","post_title":"Catalonia"}
],
"groups":[
    {"ID":83,"post_type":"groups","post_date_gmt":"2018-07-02 15:05:53","post_date":"2018-07-02 15:05:53","post_title":"Local Christian Church"}
],
"people_groups":[],
"baptized":[
    {"ID":105,"post_type":"contacts","post_date_gmt":"2018-07-17 14:54:35","post_date":"2018-07-17 14:54:35","post_title":"Jessica Blue"}
],
"baptized_by":[],
"coaching":[],
"coached_by":[],
"subassigned":[],
"relation":[],
"seeker_path":{"key":"none","label":"Contact Attempt Needed"},

"type":{"key":"media","label":"Media"},
"assigned_to":{"id":"8","type":"user","display":"Anthony Palacio (multiplier)","assigned-to":"user-8"},
"overall_status":{"key":"assigned","label":"Waiting to be accepted"},
"contact_phone":[
    {"verified":false,"value":"555-5555","key":"contact_phone_ca2"}
],
"contact_email":[
    {"verified":false,"value":"","key":"contact_email_313"}
],
"sources":["facebook"],
"accepted":false,
"gender":{"key":"male","label":"Male"},
"age":{"key":"<19","label":"Under 18 years old"},
"milestones":[
    "milestone_has_bible",
    "milestone_can_share",
    "milestone_reading_bible"
],
"baptism_generation":"0",
"baptism_date": {timestamp: "1552953600", formatted: "March 19, 2019"}
"comments":[
  {"comment_ID":"116","comment_post_ID":"72","comment_author":"David Smith","comment_author_email":"[email protected]","comment_author_url":"","comment_author_IP":"162.243.29.229","comment_date":"2018-06-05 16:07:16","comment_date_gmt":"2018-06-05 16:07:16","comment_content":"Wants a Book mailed. ","comment_karma":"0","comment_approved":"1","comment_type":"comment","comment_parent":"0","user_id":"6"}
]
}

Developer Documentation

Clone this wiki locally