1. Home
  2. Voting Board SDK
  3. Add Voters Custom Data Fields via API

Add Voters Custom Data Fields via API

Not all customers are created equal. Sometimes there’s a specific user group you want to focus on. Here are some examples:

  • Paying customers
  • Churned customers
  • Customers who signed up in the last 6 months
  • Users billing cycle

Start to get users metadata to see feedback based on priority user groups (e.g. Paying, Churned, VIP, etc.)

You can pass different users’ data into Ducalis, check this data on the Voters’ List, and create filters based on this information.

How it Works

User data is fed into Ducalis using any of the following methods:

  1. Widget
  2. Ducalis API (this article tells about it)

Authorization

Base URL API Ducalis:

https://ducalis.io/api/

Every API request must be sent with an authorization token. There two methods that can be used to send the authorization token:

  1. Query by the token parameter. For example, https://ducalis.io/api/boards?token=XXXXXX.
  2. Authorization header with Bearer xxxxx content For example:
curl --location --request POST 'https://ducalis.io/api/boards' \
--header 'Authorization: Bearer YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data-raw '[
   "test1@ducalis.io",
   "test2@ducalis.io"
]'

The token for authorization of API requests can be obtained here:

Pagination and Rate limits

Each request gets a list with a limit of 100 objects by default. The maximum limit is 500 objects. To change the limit, you need to specify the parameter per-page in the request. For example:

https://ducalis.io/api/boards?per-page=20

To specify a page, you must use the parameter page. For example:

https://ducalis.io/api/boards?page=2

User Data Management

User Data Management for B2B Companies

If you work with companies and the feedback you receive is primarily from the company, you have to use the following method to gather data. For example, in Ducalis, the customer is the entire company, and we receive transactions from a company, not from an individual customer. So, to add custom data fields we the method below.

Users can create posts, votes, and comments. The API allows you to fetch a specific user and get users’ metadata.

Creating/changing a user

Request POST voting-users

Request example:

curl --location --request POST 
'https://ducalis.io/api/voting-users?token=YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id":1,
  "name":"User Name",
  "email":"user@gmail.com",
  "avatar":"avatar_url",
  "company":{
      "id":"1",
      "name":"Company Name",
      "custom_fields":{
            "created_at":"2019-05-06T15:00:23+00:00",
            "users_count":12,
            "paying_now":true,
            "monthly_amount":0,
            "plan_name":"Demo",
            "annual_plan":false,
            "subscription_start":"2020-08-07T10:39:29+00:00"
        }
    }
}

The User Object

FieldDescription
idUser ID
emailUser email
nameUser name
avatarUser avatar
companyCompany object
company.idCompany ID
company.nameCompany name
company.custom_fieldsThe list of custom fields (see Docs)

The response from the server will be empty.

Updating user email

Request POST voting-users/email/<url_encoded_email>

Parameters:

FieldDescription
emailUser Email

Request example:

curl --location --request PUT 'https://ducalis.io/api/voting-users/email/<url_encoded_email>?token=YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"email":"user@gmail.com"}'

Removing a User

Request PUT voting-users/email/<url_encoded_email>

Request example:

curl --location --request DELETE 'https://ducalis.io/api/users/<url_encoded_email>?token=YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json' 

The response from the server will be empty.

As that data is passed into Ducalis, you can filter feedback using your customers’ metadata.

User Data Management for B2C business

If you work with individual customers and the feedback you receive is primarily from users, you have to use the following method to gather data. For example, most marketplaces or sites with video games mainly work with individual customers and receive transactions from customers. So, to add custom data fields, use the method below.

Users can create posts, votes, and comments. The API allows you to fetch a specific user and get users’ metadata.

Creating/changing a user

Request POST voting-users

Request example:

curl --location --request POST 'https://ducalis.io/api/voting-users?token=YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data-raw {
    "id":1,
    "name":"User Name",
    "email":"user@gmail.com",
    "avatar":"avatar_url",
    "company":{
        "id":"1",
        "name":"User Name",
        "custom_fields":{
            "created_at":"2019-05-06T15:00:23+00:00",
            "users_count":12,
            "paying_now":true,
            "monthly_amount":0,
            "plan_name":"Demo",
            "annual_plan":false,
            "subscription_start":"2020-08-07T10:39:29+00:00"
        }
    }
}

Important: For company":{ parameter use User’s data.

The User Object

FieldDescription
idUser ID
emailUser email
nameUser name
avatarUser avatar
companyUser object
company.idUser ID
company.nameUser name
company.custom_fieldsThe list of custom fields (see Docs)

The response from the server will be empty.

Updating User Email

Request POST voting-users/email/<url_encoded_email>

Parameters:

FieldDescription
emailUser email

Request example:

curl --location --request PUT 'https://ducalis.io/api/voting-users/email/<url_encoded_email>?token=YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"email":"user@gmail.com"}'

Removing A User

Request PUT voting-users/email/<url_encoded_email>

Request example:

curl --location --request DELETE 'https://ducalis.io/api/voting-users/<url_encoded_email>?token=YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json' 

The response from the server will be empty.

As that data is passed into Ducalis, you can filter feedback using your customers’ metadata.

Next Steps:

  1. Manage users subscriptions via Open API
  2. Manage users subscriptions via .csv
Updated on April 26, 2024

Was this article helpful?

Related Articles

Leave a Comment