Skip to main content

Import customer

About 6 min

Import customer

Single user import customer

Not in maintenance

  • URI

/wscrm-bus-api/customer/api/import

  • Request method

PUT , Content-Type : application/json

  • Request params
AttributeTypeRequiredDescription
tenantIdLongyestenant id . Get the way to contact your administrator
userNameStringyesuser name
dataListyesimport customer data
tokenStringyes
createTimeStringyesrequest time (yyyy-MM-dd HH:mm:ss)
  • data:
AttributeTypeRequiredDescription
whatsAppStringyeswhatsApp
friendNameStringnoname
sexStringBackground settingsgender: Unknown, male, female
birthdayStringBackground settingsbirthday:2020/03/08 (Currently only this format is supported)
addressStringBackground settingsaddress
emailStringBackground settingsemail
professionStringBackground settingsprofession
incomeStringBackground settingsincome
descStringBackground settingsDescription
tabNamestirngBackground settingstab names : tab1,tab2
stageStringBackground settingscustomer stage: Background settings
sourceStringBackground settingscustomer source: Background settings
languageTagStringBackground settingscustomer language: by Background download excel template
welcomeStringnowelcome content
extend fieldsStringnoSee the explanation below for details
  • Example:
{
  "tenantId": 82,
  "userName": "kubrick101",
  "data": [
    {
      "whatsApp": "15266667779",
      "friendName": "jack",
      "sex": "male",
      "birthday": "2020/03/08",
      "address": "new york",
      "email": "23@gmail.com",
      "profession": "work man",
      "income": "100 $",
      "desc": "a good man",
      "tabName": "new friend,rich man",
      "stage": "NewCustomer",
      "source": "System",
      "hi": "hi hi",
      "extendAttribute1": "exrend Attribute",
      "languageTag": "Auto",
      "welcome": "hello man"
    },
    {
      "whatsApp": "15266667779",
      "friendName": "role",
      "sex": "female",
      "birthday": "2020/03/08",
      "address": "new york",
      "email": "23@gmail.com",
      "profession": "work man",
      "income": "100 $",
      "desc": "a good man",
      "tabName": "new friend,rich man",
      "stage": "NewCustomer",
      "source": "System",
      "hi": "hi hi",
      "extendAttribute1": "exrend Attribute",
      "languageTag": "Auto",
      "welcome": "hello man"
    }
  ],
  "token": "48ac86f77f26e4719a62d3b2c569a67b",
  "createTime": "2021-03-08 14:25:00"
}
  • How the parameter is obtained

userName: user name is login account. Used to distinguish the put-to-agent of whatsApp

  • Extend attributes

According to the backend customer setting, to pass parameters for extended Attributes, use the key as the name of the extended Attribute, and the value as the value of the extended Attribute. For example:
Text: "Hello":"Hello World"
Number: "This is a number extended Attribute":123
Date: "This is a date extended Attribute":"2022-03-08"
Time: "Time":"12:00:00"
Single Selection: "Single Selection":"Option A" Multiple Selection: "Multiple Selection":"Option A,Option B"

  • Response

Correct example:

{
  "code": 200,
  "message": "Success",
  "data": {
    "successExcel": [],
    "errExcel": [],
    "successCount": 2,
    "errCount": 0,
    "notFollowSuccessCount": "",
    "notFollowSuccessExcels": []
  }
}

Error example:

{
        "code": 200,
        "message": "Success",
        "data":""
}
{
        "code": 200,
        "message": "Success",
        "data": {
            "successExcel": [],
            "errExcel": [
                {
                    "errPhone": "",
                    "errInfo": "PHONE_ERROR",
                    "errCode": 28
                },
            ],
            "successCount": 0,
            "errCount": 2,
            "notFollowSuccessCount": "",
            "notFollowSuccessExcels": []
            }
}
AttributeTypeDescription
dataStringdata (excel)
msgStringmessage
codeStringresponse code (200、500、-1) -1 is params error
  • data
AttributeDescription
errExcelimport err phone number. and err detail
errCounterr count

Customer batch import(not import pool)

  • URI

/wscrm-bus-api/customer/api/batchImport

  • Request method

POST , Content-Type : application/json

  • Request params
AttributeTypeRequiredDescription
tenantIdLongyestenant id
userNameStringyesuser login account
dataListyesimport data
tokenStringyes
createTimeStringyesrequest time (yyyy-MM-dd HH:mm:ss)
  • data:
AttributeTypeRequiredDescription
agentAccountStringyesuser login account
whatsAppStringyeswhatsApp
friendNameStringnoname
sexStringBackground settingsgender: unknown、male、female
birthdayStringBackground settingsbirthday: 2020/03/08
addressStringBackground settingsaddress
emailStringBackground settingsemail
professionStringBackground settingsprofession
incomeStringBackground settingsincome
descStringBackground settingsDescription
tabNamestringBackground settingstab names: by , split
stageStringBackground settingscustomer stage
sourceStringBackground settingscustomer source
languageTagStringBackground settingscustomer language
welcomeStringnowelcome content
extend fieldsStringnoSee the explanation below for details
  • Example:
{
  "tenantId": 82,
  "userName": "kubrick",
  "data": [
   {
      "whatsApp": "15266667779",
      "agentAccount":"kubrick101",
      "friendName": "lee",
      "sex": "female",
      "birthday": "2020/03/08",
      "address": "new york",
      "email": "23@gmail.com",
      "profession": "work man",
      "income": "100 $",
      "desc": "a good man",
      "tabName": "new friend,rich man",
      "stage": "NewCustomer",
      "source": "System",
      "hi": "hi hi",
      "extendAttribute1": "exrend Attribute",
      "languageTag": "Auto",
      "welcome": "hello man"
    },
    {
      "whatsApp": "15266667779",
      "agentAccount":"kubrick101",
      "friendName": "rose",
      "sex": "female",
      "birthday": "2020/03/08",
      "address": "new york",
      "email": "23@gmail.com",
      "profession": "work man",
      "income": "100 $",
      "desc": "a good man",
      "tabName": "new friend,rich man",
      "stage": "NewCustomer",
      "source": "System",
      "hi": "hi hi",
      "extendAttribute1": "exrend Attribute",
      "languageTag": "Auto",
      "welcome": "hello man"
    }
  ],
  "token": "48ac86f77f26e4719a62d3b2c569a67b",
  "createTime": "2021-03-08 14:25:00"
}
  • How the parameter is obtained

userName: user name is login account. Used to distinguish the put-to-agent of whatsApp

  • Extend attributes

According to the backend customer setting, to pass parameters for extended Attributes, use the key as the name of the extended Attribute, and the value as the value of the extended Attribute. For example:
Text: "Hello":"Hello World"
Number: "This is a number extended Attribute":123
Date: "This is a date extended Attribute":"2022-03-08"
Time: "Time":"12:00:00"
Single Selection: "Single Selection":"Option A" Multiple Selection: "Multiple Selection":"Option A,Option B"

  • response data:

Correct example:

{
  "code": 200,
  "message": "Success",
  "data": {
    "successExcel": [],
    "errExcel": [],
    "successCount": 2,
    "errCount": 0,
    "notFollowSuccessCount": "",
    "notFollowSuccessExcels": []
  }
}

Error example:

{
        "code": 200,
        "message": "Success",
        "data":""
}
{
        "code": 200,
        "message": "Success",
        "data": {
            "successExcel": [],
            "errExcel": [
                {
                "errPhone": "",
                "errInfo": "PHONE_ERROR",
                "errCode": 28
                },
            ],
            "successCount": 0,
            "errCount": 2,
            "notFollowSuccessCount": "",
            "notFollowSuccessExcels": []
        }
}
AttributeTypeDescription
dataStringdata (excel)
msgStringmessage
codeStringresponse code
  • data
AttributeDescription
errExcelimport error phone number
errCountimport error phone count

Customer batch import(import pool)

  • URI

/wscrm-bus-api/customer/api/batchImportWhatsContact

  • Request method

POST , Content-Type : application/json

  • Request params
AttributeTypeRequiredDescription
tenantIdLongyestenant id
userNameStringyesuser login account
dataListyesimport data
tokenStringyes
createTimeStringyesrequest time (yyyy-MM-dd HH:mm:ss)
  • data:
AttributeTypeRequiredDescription
agentAccountStringyesuser login account
whatsAppStringyeswhatsApp
friendNameStringnoname
sexStringBackground settingsgender: unknown、male、female
birthdayStringBackground settingsbirthday: 2020/03/08
addressStringBackground settingsaddress
emailStringBackground settingsemail
professionStringBackground settingsprofession
incomeStringBackground settingsincome
descStringBackground settingsDescription
tabNamestirngBackground settingstab names: by , split
stageStringBackground settingscustomer stage
sourceStringBackground settingscustomer source
languageTagStringBackground settingscustomer language
welcomeStringnowelcome content
extend fieldsStringnoSee the explanation below for details
  • Example:
{
  "tenantId": 82,
  "userName": "kubrick",
  "data": [
    {
      "whatsApp": "15266667779",
      "friendName": "lee",
      "sex": "female",
      "birthday": "2020/03/08",
      "address": "new york",
      "email": "23@gmail.com",
      "profession": "work man",
      "income": "100 $",
      "desc": "a good man",
      "tabName": "new friend,rich man",
      "stage": "NewCustomer",
      "source": "System",
      "hi": "hi hi",
      "extendAttribute1": "exrend Attribute",
      "languageTag": "Auto",
      "welcome": "hello man"
    }
    {
      "whatsApp": "15266667779",
      "friendName": "rose",
      "sex": "female",
      "birthday": "2020/03/08",
      "address": "new york",
      "email": "23@gmail.com",
      "profession": "work man",
      "income": "100 $",
      "desc": "a good man",
      "tabName": "new friend,rich man",
      "stage": "NewCustomer",
      "source": "System",
      "hi": "hi hi",
      "extendAttribute1": "exrend Attribute",
      "languageTag": "Auto",
      "welcome": "hello man"
    }
  ],
  "token": "48ac86f77f26e4719a62d3b2c569a67b",
  "createTime": "2021-03-08 14:25:00"
}
  • How the parameter is obtained

userName: user name is login account. Used to distinguish the put-to-agent of whatsApp

  • Extend attributes

According to the backend customer setting, to pass parameters for extended Attributes, use the key as the name of the extended Attribute, and the value as the value of the extended Attribute. For example:
Text: "Hello":"Hello World"
Number: "This is a number extended Attribute":123
Date: "This is a date extended Attribute":"2022-03-08"
Time: "Time":"12:00:00"
Single Selection: "Single Selection":"Option A" Multiple Selection: "Multiple Selection":"Option A,Option B"

  • Response Data

Correct example:

{
  "code": 200,
  "message": "Success",
  "data": {
    "successExcel": [],
    "errExcel": [],
    "successCount": 2,
    "errCount": 0,
    "notFollowSuccessCount": "",
    "notFollowSuccessExcels": []
  }
}

Error example:

{
        "code": 200,
        "message": "Success",
        "data":""
}
{
        "code": 200,
        "message": "Success",
        "data": {
            "successExcel": [],
            "errExcel": [
                {
                    "errPhone": "",
                    "errInfo": "PHONE_ERROR",
                    "errCode": 28
                },
            ],
            "successCount": 0,
            "errCount": 2,
            "notFollowSuccessCount": "",
            "notFollowSuccessExcels": []
        }
}
AttributeTypeDescription
dataStringdata (excel)
msgStringmessage
codeStringresponse code
  • data
AttributeDescription
errExcelimport error phone number
errCountimport error phone count

Customer batch import (role attribute append)

  • URI

/wscrm-bus-api/customer/api/batchImportAppend

  • Request method

POST , Content-Type : application/json

  • Request params
AttributeTypeRequiredDescription
tenantIdLongyestenant id
userNameStringyesuser login account
dataListyesimport data
tokenStringyes
createTimeStringyesrequest time (yyyy-MM-dd HH:mm:ss)
  • data:
AttributeTypeRequiredDescription
agentAccountStringyesuser login account
whatsAppStringyeswhatsApp
friendNameStringnoname
sexStringBackground settingsgender: unknown、male、female
birthdayStringBackground settingsbirthday: 2020/03/08
addressStringBackground settingsaddress
emailStringBackground settingsemail
professionStringBackground settingsprofession
incomeStringBackground settingsincome
descStringBackground settingsDescription
tabNamestirngBackground settingstab names: by , split
stageStringBackground settingscustomer stage
sourceStringBackground settingscustomer source
languageTagStringBackground settingscustomer language
welcomeStringnowelcome content
extend fieldsStringnoSee the explanation below for details

Example:

{
  "tenantId": 82,
  "userName": "kubrick",
  "data": [
   {
      "whatsApp": "15266667779",
      "friendName": "lee",
      "sex": "female",
      "birthday": "2020/03/08",
      "address": "new york",
      "email": "23@gmail.com",
      "profession": "work man",
      "income": "100 $",
      "desc": "a good man",
      "tabName": "new friend,rich man",
      "stage": "NewCustomer",
      "source": "System",
      "hi": "hi hi",
      "extendAttribute1": "exrend Attribute",
      "languageTag": "Auto",
      "welcome": "hello man"
    }
    {
      "whatsApp": "15266667779",
      "friendName": "rose",
      "sex": "female",
      "birthday": "2020/03/08",
      "address": "new york",
      "email": "23@gmail.com",
      "profession": "work man",
      "income": "100 $",
      "desc": "a good man",
      "tabName": "new friend,rich man",
      "stage": "NewCustomer",
      "source": "System",
      "hi": "hi hi",
      "extendAttribute1": "exrend Attribute",
      "languageTag": "Auto",
      "welcome": "hello man"
    }
  ],
  "token": "48ac86f77f26e4719a62d3b2c569a67b",
  "createTime": "2021-03-08 14:25:00"
}
  • How the parameter is obtained

userName: user name is login account. Used to distinguish the put-to-agent of whatsApp

  • extend Attributes

According to the backend customer setting, to pass parameters for extended Attributes, use the key as the name of the extended Attribute, and the value as the value of the extended Attribute. For example:
Text: "Hello":"Hello World"
Number: "This is a number extended Attribute":123
Date: "This is a date extended Attribute":"2022-03-08"
Time: "Time":"12:00:00"
Single Selection: "Single Selection":"Option A" Multiple Selection: "Multiple Selection":"Option A,Option B"

  • Rsponse data

Correct example:

{
  "code": 200,
  "message": "Success",
  "data": {
    "successExcel": [],
    "errExcel": [],
    "successCount": 2,
    "errCount": 0,
    "notFollowSuccessCount": "",
    "notFollowSuccessExcels": []
  }
}

Error example:

{
        "code": 200,
        "message": "Success",
        "data":""
}
{
        "code": 200,
        "message": "Success",
        "data": {
            "successExcel": [],
            "errExcel": [
                {
                "errPhone": "",
                "errInfo": "PHONE_ERROR",
                "errCode": 28
                },
            ],
            "successCount": 0,
            "errCount": 2,
            "notFollowSuccessCount": "",
            "notFollowSuccessExcels": []
            }
}
AttributeTypeDescription
dataStringdata (excel)
msgStringmessage
codeStringresponse code
  • data
AttributeDescription
errExcelimport error phone number
errCountimport error phone count
  • Error code
CodeDescription
-1token error / TenantId Is Null / Admin Cannot import data / Data Is Null
10sex Attribute error
14source error
15stage error
16languageTag error
19The quantity exceeds the limit
21extend fields The content exceeds the specified length
22Required Attribute Not filled in
23extend fields - number Type error
24extend fields - date Type error / birthday Attribute Type yyyy/MM/dd
25extend fields - time Type error HH:mm:ss
26extend fields -Radio Type error
27extend fields -Multiple selection Type error
28phone error
29phone is empty
51country Attribute is empty
56friendWhatsId Processing(One-minute interval)
58extend fields - file Type url The number of tickets exceeds 10
59extend fields - The attachment has an invalid address or network fluctuations or a large file
60extend fields - The attachment Type file is too large
Last update:
Contributors: songjun,zhangzhuangzhuang