Customers

Attributes

Name Type Description
resource_uri reference read only
company reference  
preferred_language string  
account_type string

Possible values: hiring-manager, recruiter, admin, owner.

See User Roles workflow

user reference  
username string optional (cannot be PATCH’ed)
first_name string optional
last_name string optional
phone string optional
status string optional
confirmationdate timestamp optional
gender string optional
activation_key string optional
created_by string optional
role string optional
receive_interview_notifications bool optional
photo reference optional
position string optional
invitationdate timestamp optional
email string  
projects reference read only
seen_welcome bool optional

List

/companies/{{companyId}}/customers/

Methods

  • GET
  • POST

Example response

{"meta":{
    "total_count":1,
    "previous":null,
    "next":null
 },
 "objects":[
    {"resource_uri":"https://interview-suite.com/api/v3/companies/1/customers/1/",
     "first_name":"Leona",
     "last_name":"Kes\u00e4",
     "gender":"mrs",
     "company":"https://interview-suite.com/api/v3/companies/1/",
     "photo":"https://interview-suite.com/api/v3/companies/1/customers/1/photo/a76b5e78cd3/",
     "email":"mario.brandao+leona@viasto.com"
     }
   ]
 }

Identifying a customer from username

A third party system might need to retrieve a customer’s resource_uri knowing only a customer’s username. For example, if the third party system created the user with a specific username but didn’t store the resource_uri that was returned. Note that the response will be a list/array.

/companies/{{companyId}}/customers/?username={{username}}

Example Response:

{
  "meta": {
    "next": null,
    "previous": null,
    "total_count": 1
  },
  "objects": [
    {
      "account_type": "hiring-manager",
      "company": "https://interview-suite.com/api/v3/companies/1/",
      "email": "Smith@viasto.vv",
      "first_name": "John",
      "gender": "",
      "is_active": true,
      "last_name": "Smith",
      "photo": "",
      "position": null,
      "preferred_language": "de",
      "resource_uri": "https://interview-suite.com/api/v3/companies/1/customers/1/"
    }
  ]
}

Object

/companies/{{companyId}}/customers/{{customerId}}/

Methods

  • GET
  • PATCH
  • DELETE

Deleting a customer record will trigger an email to the customer informing them of the deletion. This email will contain the details of the user who deleted them.

Example response

{
  "photo": "",
  "phone": "",
  "account_type": "recruiter",
  "preferred_language": "en",
  "resource_uri": "https://interview-suite.com/api/v3/companies/4/customers/31/",
  "created_by": "https://interview-suite.com/api/v3/customusers/143/",
  "company": "https://interview-suite.com/api/v3/companies/4/",
  "first_name": "John",
  "invitationdate": "2015-09-29T07:18:00Z",
  "confirmationdate": null,
  "username": "jsmith1234",
  "receive_interview_notifications": true,
  "last_name": "Smith",
  "email": "john.smith@viasto.com",
  "gender": "mr",
  "status": "confirmed",
  "seen_welcome": false
}

Photo

You can upload a photo for a customer when creating them (POST) or when updating them (PATCH). Photo uploads can be a data URI or encoded as multipart/form-data.

multipart/form-data examples:

curl -X POST -H 'Authorization: Token <your token>' \
-F "photo=@profile-picture.jpg" \
-F "first_name=Luke" \
-F "last_name=Skywalker" \
-F "email=luke.skywalker@darkside.moon" \
-F "account_type=recruiter" \
-F "preferred_language=de" \
https://interview-suite.com/api/v3/companies/2/customers/
curl -X PATCH -H 'Authorization: Token <your token>' \
-F "photo=@profile-picture.jpg" \
https://interview-suite.com/api/v3/companies/2/customers/51/

Data URI examples:

curl -X POST \
-H 'Authorization: Token <your token>' \
-H 'Content-Type: application/json' \
-d '{ \
  "first_name": "Luke", \
  "last_name": "Skywalker", \
  "email": "max.ludwig@viasto.com", \
  "account_type": "recruiter", \
  "preferred_language": "de", \
  "photo":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1JREFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jqch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0vr4MkhoXe0rZigAAAABJRU5ErkJggg==" \
}' \
https://interview-suite.com/api/v3/companies/2/customers/
curl -X PATCH \
-H 'Authorization: Token <your token>' \
-H 'Content-Type: application/json' \
-d '{"photo":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1JREFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jqch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0vr4MkhoXe0rZigAAAABJRU5ErkJggg=="}' \
https://interview-suite.com/api/v3/companies/2/customers/51/

Note

The URL of a photo or a CV is generated with time limited token for security concerns and provided by candidate resource response, which means each user session will get different tokens every time candidate is requested. The token expires when the authorization token expires.

Depending on content a valid content type is returned (i.e. JPEG, PNG, PDF).

Resend registration email

/companies/{{companyId}}/customers/{{customerId}}/reinvite/

Methods

  • PATCH

This method resends invitation email to customer and invalidates previously generated invitation tokens. Can be used only for customers in ‘invited’ state. Only account owners and admins are permitted to use this method.

Returns status 200 if email was successfully resent or error code and explanary message in case of failure.

Batch importing

It is possible to batch import a list of customers with simple data using the following endpoint:

/companies/{{companyId}}/customers/batch-import/

Methods

  • POST

When calling this endpoint, you must provide a list with all active customers:

[
  {
    "pk_attribute": "username",
    "username": "luffy1129",
    "email": "mugiwara@pirates.jp",
    "first_name": "Monkey",
    "last_name": "D. Luffy",
    "account_type": "recruiter",
    "gender": "mr",
    "position": "Pirate king"
  },
  {
    "pk_attribute": "username",
    "username": "zoro0923",
    "email": "r.zoro@pirates.jp",
    "first_name": "Roronoa",
    "last_name": "Zoro",
    "account_type": "recruiter",
    "gender": "mr",
    "position": "Swordsman"
  },
  ...
]

Upon receiving this list, the API will deactivate every customer from the company that is not on it, as well as create every user that is on the list but not on the system. Updates are not supported.

Attributes

Name Type Description
pk_attribute string

Possible values: username, email

Specify which field is to be used as primary key

account_type string

Possible values: hiring-manager, recruiter, admin, owner.

See User Roles workflow

username string  
email string  
first_name string  
last_name string  
gender string optional
position string optional