Requirements
- E-goi Account
- E-goi API Key
Scenario
You need to import all leads from your application (e.g. a CRM) to an E-goi list.
1. Creating a list
E-goi accounts include a ready-to-use contact list, but you can create extra lists if needed. Each list can have their own settings.
To create the list via API, let’s use the Create List method.
E-goi Public API Server -> https://api.egoiapp.com/lists
Payload Example:
{
"internal_name": "Internal name",
"public_name": "Public name"
}
Answer Payload Example:
{
"list_id": 1,
"internal_name": "Internal name",
"public_name": "Public name",
"status": "active",
"group_id": 0,
"created": "YYYY-MM-DD hh:mm:ss",
"updated": "YYYY-MM-DD hh:mm:ss"
}
2. Importing Contacts
Doing a bulk import is the easiest way to transfer all leads from your application to your E-goi contact list in a single go.
To import contacts via API, let’s use the Import Collection of Contacts method
NOTE!
Minimum of 2 contacts to use this method. If you’d rather import individual contacts one by one, use the Create Contact method.
E-goi Public API Server: https://api.egoiapp.com/lists/{list_id}/contacts/actions/import-bulk
Replace {list_id} with E-goi’s list ID.
Example Payload:
{
"mode": "add",
"compare_field": "email",
"contacts": [
{
"base": {
"status": "active",
"first_name": "John",
"last_name": "Doe",
"birth_date": "1975-01-10",
"language": "en",
"email": "example@e-goi.com",
"cellphone": "351-300404336",
"phone": "351-300404336",
"push_token_android": [
{
"app_id": "string",
"token": "string"
}
],
"push_token_ios": [
{
"app_id": "string",
"token": "string"
}
]
},
"extra": [
{
"field_id": 1,
"value": "2019-01-01"
}
]
}
],
"force_empty": false,
"notify": [
0
],
"callback_url": "string"
}
Answer Payload Example:
{
"result": "success"
}
Once E-goi’s API processes your request, you should see your contacts in the list. When importing contacts, you can also include the contacts Base field data (eg. their name, email, mobile, etc.) and Extra field data (eg. postal address, type of customer, etc.). If you’re posting data for Extra fields, you’ll need to have created those fields in E-goi beforehand.