POST /managers – REST API

Create a Manager: POST /managers

Create a completely new manager in the account. Must have open manager seats for this method to succeed.

URL Parameters
Values should be paramaterized such as using http_build_query() as per example below. All field are required.

  • first_name: REQUIRED – Manager’s first name.
  • last_name: REQUIRED – Manager’s last name.
  • email: REQUIRED – Manager’s email, must be unique.
  • password: REQUIRED – Manager’s password. Minimum 8 characters.
  • role: REQUIRED – Manager’s role in the account. If assigned a ‘manager’ or ‘lender’ role, collection assignment must be completed by the account owner using the website. Allowed values: admin, manager, lender

JSON Result Details
Password is never returned in result set.

  • first_name: Manager’s first name.
  • last_name: Manager’s last name.
  • email: Manager’s email.
  • role: The managerial role for this user.
<?php
$curl = curl_init();

$params = array(
  'first_name' => 'Scott',
  'last_name' => 'Pilgrim',
  'email' => 'sbobomb@example.com',
  'password' => 'aqbq340as94ikd242ffp',
  'role' => 'admin'
);

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.libib.com/managers?" . http_build_query($params),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_CONNECTTIMEOUT => 5,
  CURLOPT_TIMEOUT => 15,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => array(
    "x-api-key: YOUR_API_KEY",
    "x-api-user: YOUR_API_USER"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $obj = json_decode($response);
}
{
    "first_name": "Scott",
    "last_name": "Pilgrim",
    "email": "sbobomb@example.com",
    "role": "admin"
}
Updated on February 17, 2023
Was this article helpful?

Related Articles