Integrate leadsyncer.com with other systems with the REST api
Wish you could import the generated leads directly into your CRM / ERP system? You can achieve this goal easily with our REST api.
What is REST / why didn't you use SOAP?
Our REST api uses simple HTTP GET calls and returns the records JSON encoded. This is very easy to implement in any programming language and doesn't include the overhead SOAP requires. You can even see the records transmitted over our REST api in the browser!
Try it: https://leadsyncer.com/restapi/lead/byTimestamp/0
Authentication
Use HTTPS and Basic authentication. Use the same credentials you use to login to the website.
Usage to receive leads
You use an URL with the following scheme to retrieve leads:
https://leadsyncer.com/restapi/lead/byTimestamp/0
This returns all leads with a time stamp greater than 0. Just remember the largest time stamp you receive and pass it the next time to the URL and you'll receive only modified leads the next run.
Use HTTP Basic Authentication to retrieve the records and remember to use HTTPS; you don't want to transfer your credentials and leads in clear text over the Internet.
Explanation of the returned lead records
An record returned by the api looks like this example:
{"uid":"77","tstamp":"1288707245","crdate":"1288703714","deleted":"0","sheet_uid":"29","device_uid":"105",
"fields":[
{"title":"Address line 1","type":0,"value":"Kniestr. 27"},
{"title":"Salutation","type":5,"value":"Mr"},{"title":"Notice","type":1,"value":""},
{"title":"Postal code","type":0,"value":"30167"},{"title":"Last name","type":0,"value":"Schulz"},
{"title":"First name","type":0,"value":"Fabian"},{"title":"Phone","type":0,"value":"0049-511-1235057-0"},
{"title":"City","type":0,"value":"Hannover"},{"title":"State","type":0,"value":"Niedersachsen"},
{"title":"Position","type":0,"value":"CEO"},{"title":"Country","type":0,"value":"Germany"},
{"title":"Title","type":0,"value":""},{"title":"Address line 2","type":0,"value":""},
{"title":"E-mail","type":0,"value":"Schulz@customaze.de"},{"title":"Preferred call time","type":3,"value":"2010-11-02T12:15:44+0000"},
{"title":"Company","type":0,"value":"customaze GmbH"}]}
The records are separated by \n (simple newlines). Each record is by itself encoded in JSON. This means that multiple records do not form a JSON array.
The properties of the record:
- uid: Uniquely identified the record and never changes.
- tstamp: UNIX time stamp with the date of the last modification. Use this to determine if the record has changed.
- crdate: UNIX time stamp with the date when the record was created.
- deleted: When the record is deleted on the iPad client this is set to 1 (the record itself will not be really deleted).
- sheet_uid: The form that was used to create the record.
- device_uid: The device on which the record was created.
- fields: An array of field records containing the data.
The properties of the fields:
- title: The name of the field as defined in the form.
- type: The field type (see below).
- value: The field's value.
Possible field types:
- 0: A single line text field
- 1: A multi line text field
- 2: Date only
- 3: Time only
- 4: Date and Time
- 5: Picker field with custom values
Usage to retrieve forms
You use an URL with the following scheme to retrieve leads:
https://leadsyncer.com/restapi/form/byTimestamp/0
This returns all forms with a time stamp greater than 0. Just remember the largest time stamp you receive and pass it the next time to the URL and you'll receive only modified forms the next run.
Use HTTP Basic Authentication to retrieve the records and remember to use HTTPS; you don't want to transfer your credentials and forms in clear text over the Internet.
Explanation of the returned form records
A record returned by the api looks like this example:
{"uid":"29","tstamp":"1288620658","deleted":"0","title":"Sample form","fields":[{"uid":"237","deleted":"0","title":"Salutation","type":"5","picker_values":"Mr\nMrs\nMs","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"1","position_y":"1"},
{"uid":"236","deleted":"0","title":"Title","type":"0","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"2","position_y":"1"},
{"uid":"235","deleted":"0","title":"Notice","type":"1","picker_values":"","keyboard_type":"0","size_x":"2","size_y":"2","position_x":"1","position_y":"10"},
{"uid":"238","deleted":"0","title":"First name","type":"0","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"1","position_y":"2"},
{"uid":"239","deleted":"0","title":"Last name","type":"0","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"2","position_y":"2"},
{"uid":"240","deleted":"0","title":"Company","type":"0","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"1","position_y":"3"},
{"uid":"241","deleted":"0","title":"Position","type":"0","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"2","position_y":"3"},
{"uid":"242","deleted":"0","title":"Date of birth","type":"2","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"1","position_y":"4"},
{"uid":"243","deleted":"0","title":"Preferred call time","type":"3","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"2","position_y":"4"},
{"uid":"244","deleted":"0","title":"Address line 1","type":"0","picker_values":"","keyboard_type":"0","size_x":"2","size_y":"1","position_x":"1","position_y":"5"},
{"uid":"245","deleted":"0","title":"Address line 2","type":"0","picker_values":"","keyboard_type":"0","size_x":"2","size_y":"1","position_x":"1","position_y":"6"},
{"uid":"246","deleted":"0","title":"Postal code","type":"0","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"1","position_y":"7"},
{"uid":"247","deleted":"0","title":"City","type":"0","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"2","position_y":"7"},
{"uid":"248","deleted":"0","title":"State","type":"0","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"1","position_y":"8"},
{"uid":"249","deleted":"0","title":"Country","type":"0","picker_values":"","keyboard_type":"0","size_x":"1","size_y":"1","position_x":"2","position_y":"8"},
{"uid":"250","deleted":"0","title":"Phone","type":"0","picker_values":"","keyboard_type":"5","size_x":"1","size_y":"1","position_x":"1","position_y":"9"},
{"uid":"251","deleted":"0","title":"E-mail","type":"0","picker_values":"","keyboard_type":"7","size_x":"1","size_y":"1","position_x":"2","position_y":"9"}]}
The records are separated by \n (simple newlines). Each record is by itself encoded in JSON. This means that multiple records do not form a JSON array.
The properties of the record:
- uid: Uniquely identifies the record and never changes.
- tstamp: UNIX time stamp with the date of the last modification. Use this to determine if the record has changed.
- crdate: UNIX time stamp with the date when the record was created.
- deleted: Whether the form is enabled (0: Enabled, 1: Disabled)
- title: Name of the form
- fields: An array of field records containing the field definition of the form.
The properties of the fields:
- uid: Uniquely identifies the record and never changes.
- deleted: Whether the field has been deleted.
- title: The name of the field.
- type: The field type (see below, identical to the field types of the lead record).
- picker_values: On Picker fields this property contains all possible values separated by \n
- keyboard_type: On single line text fields, this defines the keyboard type (see below)
- size_x, size_y: The size of the field in columns or rows.
- position_x, position_y: The position of the field on the form in row / column.
Possible field types:
- 0: A single line text field
- 1: A multi line text field
- 2: Date only
- 3: Time only
- 4: Date and Time
- 5: Picker field with custom values
Possible keyboard types:
- 0: Default
- 1: ASCII
- 2: Numbers and Punctuation
- 3: URL
- 4: Number pad
- 5: Phone pad
- 6: Name Phone pad
- 7: E-Mail address