User import

Method: evaluate import csv

Authorization is required. Evaluates a csv file prepared for import and in the format: email, first name, last name. New line for record separator. It matches it to the current group's members and produces a result, which is used later by the next method for the actual import.

Request

HTTP request

POST https://<YOUR_DOMAIN>/api/v1/en_US/user/import-evaluate-csv

Parameters

Do not supply a request parameters with this method.

Request body

propertyvaluedescription
group guid The group Id in which you need to import the emails.
roleId integer In what role you need to import them. The alternatives are:
  • 2 - regular
  • 3 - member
  • 4 - moderator
  • 5 - administrator
blocked boolean Whether the imported emails should be imported as blocked. Used for mass blocking emails
csvPath string Url to the CSV file that needs to be evaluated. The file should be in the format: email, first name, last name. New line for record separator.
selectedFields list (guid) List if profile fields' ids that you need to import data too. Could be null if you do not need to import data in profile fields. If you do, the order of the profile fields' ids should correspond to the order of the columns in the provided CSV. Only fields with values convertable to string can be provided.

Response

If successful, this method returns a response JSON with the following structure:

{
  "success": true,
  "message": "Qui Lorem velit laborum aute duis sunt.",
  "timestamp": "2014-03-03T23:20:23Z",
  "errors": [
    {
      "key": "csvPath",
      "value": "http://demo.hivesocialnow.com/ClientFiles/bc7fbf51-7930-4550-98b0-6a3ff6111ebe/users.csv",
      "message": "The csv file is with wrong format"
    }
  ],
  "object": {
    "input": {
      "roleId": 1,
      "blocked": false,
      "csvPath": "http://demo.hivesocialnow.com/ClientFiles/bc7fbf51-7930-4550-98b0-6a3ff6111ebe/users.csv",
      "selectedFields": [
        "11197a91-b4eb-45b2-958a-07dae6213011",
        "11197a91-b4eb-45b2-958a-07dae6213011",
        "11197a91-b4eb-45b2-958a-07dae6213011",
        "11197a91-b4eb-45b2-958a-07dae6213011"
      ]
    },
    "output": [
      {
        "type": "importRow",
        "email": "lottrobinson@isoplex.com",
        "resultId": 1,
        "resultName": "New user",
        "fields": [
          {
            "id": "11197a91-b4eb-45b2-958a-07dae6213011",
            "name": "Email",
            "value": "lottrobinson@isoplex.com"
          },
          {
            "id": "11197a91-b4eb-45b2-958a-07dae6213021",
            "name": "First name",
            "value": "Joan"
          }
        ]
      }
    ]
  }
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

propertyvaluedescription
input object Has a csvPath property, which is the provided for evaluation URL of the CSV file.
output List (object) List of the CSV file records but evaluated and with provided possible result of the import. The most important property of these objects is the resultId. It alternates as follows:
  • 1 - New user - Record will be imported, email with login URL, username and password will be sent.
  • 2 - Group member - The information about this user account (email) will be updated (ex. first and last name will be updated). Often used to bulk update user security group.
  • 3 - Existing account - This user already has an HiveSocial ID account in the corresponding profile server, but is not a member of this community. The system will send an email with login URL only.
  • 4 - Invalid email - It will not be imported and no email will be sent.

Method: bulk import

Authorization is required. Bulk imports a list of records as group members.

Request

HTTP request

POST https://<YOUR_DOMAIN>/api/v1/en_US/user/bulk-import

Parameters

Do not supply a request parameters with this method.

Request body

propertyvaluedescription
group guid The group Id in which you need to import the emails.
roleId integer In what role you need to import them. The alternatives are:
  • 2 - regular
  • 3 - member
  • 4 - moderator
  • 5 - administrator
blocked boolean Whether the imported emails should be imported as blocked. Used for mass blocking emails
records List (object) List of record objects scheduled for import. Each record represents one member that should be imported. The record object has one property fields which is an array of objects with properties representing the profile fields being imported:
  • id - the id of the imported field
  • name - the name of the imported field
  • value - the imported value

Response

If successful, this method returns a response JSON with the following structure:

{
    "success": false,
    "message": "Qui Lorem velit laborum aute duis sunt.",
    "timestamp": "2014-03-03T23:20:23Z",
    "errors": [
		{
		"key":"",
		"value":"",
		"message": "System error occured"
		}],
    "object": {

    }
}

The general response properties are described on the Response format page.