Create Person

When you call Person Service with POST method, you can create a person on next4biz CRM.

Your request body must be contain 4 properties.

  • tenant_slug This is your subdomain on selphiu URL. For example: if your selphiu domain is “acme.selpihu.com” then your tenant_slug is “acme”
  • access_token next4biz CRM provide an access_token via access_token service. Every access_token expires after 15 minutes. Best Practice, you request a new access_token for each service request.
  • channel This is bussines channel id. If you don’t know your bussiness_channels and there’s id numbers. You can learn via bussiness_channel service.
  • person This is an array includes objects as person property is an object contain your new person values. You must set name and surname properties. But others are arbitrary. You can sent 500 person each request

Explanations about the sample

  • gender_id value may be Mr. for 1 or 2 for Mrs.
  • birthdate format is Year(4 digit)-Month(2digit)-Day(2 digit). example: 1979-02-11 like YYYY-MM-DD
  • default_email_index is arbitary field and default is 0
  • default_phone_index is arbitary field and default is 0
  • default_address_index is arbitary field and default is 0
  • custom_field_values 236 id numbered custom field type is date, 237 id numbered custom field type is datetime. The both custom field values are time stamp as miliseconds.
  • custom_field_values 241 id numbered custom field type is list and value is id number of this custom field values.
  • custom_field_values 240 id numbered custom field type is multiple list and value is joined with “,” id numbers from this custom field values.
  • custom_field_values 239 id numbered custom field type is number.
  • custom_field_values 235 id numbered custom field type is text.
You can learn about info your person custom field via Custom Field Service
Name Value
REST-API METHOD Create Person
HTTP METHOD POST
RESPONSE TYPE JSON
URL https://api.crm.next4biz.com/person/
REQUEST HEAD Accept: application/json; Content-Type: application/json
ENDPOINT DEFINITION
POST
SAMPLE REQUEST BODY
{
	"tenant_slug": "acme",
	"channel": "79",
	"access_token": "[YOUR ACCESSTOKEN]",
	"person": [
		{
			"name": "John",
			"surname": "Doe",
			"company": {
				"company_id": 41244
			},
			"title_text": "Super IT Manager",
			"title": {
				"title_id": "181"
			},
			"gender": {
				"gender_id": "1"
			},
			"birthdate": "1979-02",
			"linkedin_id": "987654321",
			"linkedin_url": "https://www.linkedin.com/in/jhondoe/",
			"citizenship_number": "12345678911",
			"emails": [
				"[email protected]",
				"[email protected]",
				"[email protected]"
			],
			"default_email_index": 0,
			"phones": [
				"05325553322"
			],
			"default_phone_index": 0,
			"addresses": [
				{
					"address": "elm sokağı no:16",
					"city": "5030",
					"district": "158",
					"country": "225"
				}
			],
			"default_address_index": 0,
			"custom_field_values": [
				{
					"id": 236,
					"value": "1504704612000"
				},
				{
					"id": 237,
					"value": "1504704612000"
				},
				{
					"id": 241,
					"value": "1"
				},
				{
					"id": 240,
					"value": "1,2,3"
				},
				{
					"id": 239,
					"value": "50"
				},
				{
					"id": 235,
					"value": "Lorem ipsum dolor sit amet"
				}
			]
		}
	]
}
SAMPLE RESPONSE BODY
{
	"code": 200,
	"status": "Success",
	"result": [
		{
			"person_id": 283128,
			"name": "John",
			"mname": null,
			"surname": "Doe",
			"full_name": "John Doe",
			"company": {
				"company_id": "41244",
				"company_name": "acme company",
				"master_company_id": null,
				"unique_id": null,
				"resource": "",
				"create_owner": {
					"user_id": 272,
					"user_name": "scoobe.doo",
					"email": "[email protected]",
					"created_at": "2017-09-20 11:53:41",
					"updated_at": "2017-09-20 11:53:41",
					"lang": "tr",
					"profile_picture": null
				},
				"last_update_owner": {
					"user_id": 272,
					"user_name": "scoobe.doo",
					"email": "[email protected]",
					"created_at": "2017-09-20 11:53:41",
					"updated_at": "2017-09-20 11:53:41",
					"lang": "tr",
					"profile_picture": null
				},
				"created_at": "2017-09-07 15:26:31",
				"update_at": "2017-09-08 10:43:48",
				"vertical": null,
				"default_phone": null,
				"default_address": null,
				"default_domain": null,
				"default_email_format": null,
				"custom_data": {
					"cf_221": "",
					"cf_222": "",
					"cf_223": "",
					"cf_224": "",
					"cf_225": "",
					"cf_226": [
						""
					],
					"cf_228": "",
					"cf_229": "",
					"cf_230": "",
					"cf_231": "",
					"cf_232": "",
					"cf_233": [
						""
					]
				}
			},
			"title_text": "Super IT Manager",
			"resource": null,
			"created_at": "2017-09-07",
			"updated_at": "2017-09-07",
			"linkedin_id": "987654321",
			"linkedin_url": "https://www.linkedin.com/in/jhondoe/",
			"citizenship_number": null,
			"create_owner": null,
			"last_update_owner": null,
			"unique_id": null,
			"channel": {
				"channel_id": "79",
				"channel_name": "Jhony",
				"channel_slug": "jhony",
				"created_at": "2017-09-05 11:53:41",
				"lang": "tr",
				"is_builtin": true,
				"business_type": 1
			},
			"custom_data": {
				"cf_235": "Lorem ipsum dolor sit amet",
				"cf_236": "1504704612000",
				"cf_237": "1504704612000",
				"cf_239": "50",
				"cf_240": [
					"1",
					"2",
					"3"
				],
				"cf_241": "1"
			},
			"default_email": {
				"person_email_id": "217510",
				"email_address": "[email protected]",
				"created_at": null,
				"updated_at": null,
				"is_incorrect": false,
				"person_id": 283128
			},
			"default_address": {
				"person_address_id": 178684,
				"address": "elm sokağı no:16",
				"country": {
					"country_id": 225,
					"country_name": "Turkey",
					"country_code": "TR"
				},
				"district": {
					"district_id": "158",
					"district": "Mengen",
					"city_id": 5030,
					"country_id": 225
				},
				"city": {
					"city_id": 5030,
					"city_name": "Bolu",
					"country_id": 225
				},
				"person_id": 283128
			},
			"title": {
				"title_id": 181,
				"title_name": "Superior Person",
				"tenant": {
					"tenant_id": 74,
					"tenant_name": "acme",
					"tenant_slug": "acme",
					"created_at": "2017-09-05 11:53:41"
				}
			},
			"default_phone": {
				"person_phone_id": "192000",
				"person_id": 283128,
				"created_at": "2017-09-07 11:11:51",
				"phone": "05325553322"
			}
		}
	]
}