NAV
shell ruby python csharp php

User

The User object

The User object looks like this in JSON:

{
    "object": "user",
    "id": 16,
    "username": "academic.admin",
    "organization_domain_id": null,
    "is_active": true,
    "blocked_reason": "",
    "last_activity_at": null,
    "login_type": "ALL",
    "sandbox": true
}
Attribute Required Data Type
id Yes int
username Yes text (100)
organization_domain_id No int
is_active Yes bool
blocked_reason No text (500)
last_activity_at No datetime
login_type Yes enum (all, populi, sso)
sandbox No bool

index

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/users" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/users',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/users',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/users"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/users');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "list",
    "count": 40,
    "results": 40,
    "results_per_page": null,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "user",
            "id": 16,
            "username": "academic.admin",
            "organization_domain_id": null,
            "is_active": true,
            "blocked_reason": "",
            "last_activity_at": null,
            "login_type": "ALL"
        }
    ],
    "sandbox": true
}

Retrieves all User objects.

HTTP Request

GET /users

Parameters

None

Permissions

One of the following roles is required to call this method:

create

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/users/(person)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X POST
require 'httparty'
response = HTTParty.post(
 'https://yourschool.populiweb.com/api2/users/(person)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.post(
 'https://yourschool.populiweb.com/api2/users/(person)',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/users/(person)"), Method.Post);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/users/(person)');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "user",
    "id": 23,
    "username": "bsmith26",
    "organization_domain_id": null,
    "is_active": true,
    "blocked_reason": null,
    "last_activity_at": null,
    "login_type": "ALL",
    "sandbox": true
}

Creates a new User object.

HTTP Request

POST /users/(person)

Parameters

Name Required Data Type Description
username No text (100)
organization_domain_id No int
login_type No enum (all, populi, sso) Only used when SSO is enabled. Defaults to 'sso' when SSO is enabled. When SSO is not enabled the value will be 'all'.

Action Parameters

Name Data Type Description
send_welcome_email Default is false

show

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/users/(user)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/users/(user)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/users/(user)',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/users/(user)"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/users/(user)');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "user",
    "id": 16,
    "username": "academic.admin",
    "organization_domain_id": null,
    "is_active": true,
    "blocked_reason": "",
    "last_activity_at": null,
    "login_type": "ALL",
    "sandbox": true
}

Retrieves a specific User object.

HTTP Request

GET /users/(user)

Parameters

No additional parameters are needed beyond the ID of the object being requested that appears in the URL.

Permissions

One of the following roles is required to call this method:

delete

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/users/(user)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X DELETE
require 'httparty'
response = HTTParty.delete(
 'https://yourschool.populiweb.com/api2/users/(user)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.delete(
 'https://yourschool.populiweb.com/api2/users/(user)',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/users/(user)"), Method.Delete);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/users/(user)');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "user",
    "id": 24,
    "deleted": true
}

Deletes an existing User object.

HTTP Request

DELETE /users/(user)

Parameters

No additional parameters are needed beyond the ID of the object to delete that appears in the URL.

block

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/users/(user)/block" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X POST
require 'httparty'
response = HTTParty.post(
 'https://yourschool.populiweb.com/api2/users/(user)/block',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.post(
 'https://yourschool.populiweb.com/api2/users/(user)/block',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/users/(user)/block"), Method.Post);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/users/(user)/block');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "user",
    "id": 21,
    "username": "deleteme1",
    "organization_domain_id": null,
    "is_active": false,
    "blocked_reason": "",
    "last_activity_at": null,
    "login_type": "ALL",
    "sandbox": true
}

HTTP Request

POST /users/(user)/block

Parameters

Name Required Data Type Description
blocked_reason No text (500)

enable_external_email_account

curl "https://yourschool.populiweb.com/api2/users/(user)/enable_external_email_account" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
-d '{
    "make_system_email_primary_email": true
}' \ 
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/users/(user)/enable_external_email_account',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
 body: {
  :make_system_email_primary_email => 1
 }.to_json
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/users/(user)/enable_external_email_account',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
 json={
  'make_system_email_primary_email': 1
 }
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/users/(user)/enable_external_email_account"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
request.AddJsonBody(new {
  make_system_email_primary_email = 1
});
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/users/(user)/enable_external_email_account');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode([
  'make_system_email_primary_email' => 1
]));
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{}

If your school is using the Google integration, this will trigger a matching system email account to be created on the Google side for a User that does not have one yet. This call will begin the operation in the backround, but it typically takes 1-2 minutes for the new Google account to show up.

HTTP Request

GET /users/(user)/enable_external_email_account

Parameters

Name Required Data Type Description
make_system_email_primary_email Yes bool

unblock

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/users/(user)/unblock" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X POST
require 'httparty'
response = HTTParty.post(
 'https://yourschool.populiweb.com/api2/users/(user)/unblock',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.post(
 'https://yourschool.populiweb.com/api2/users/(user)/unblock',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/users/(user)/unblock"), Method.Post);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/users/(user)/unblock');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "user",
    "id": 21,
    "username": "deleteme1",
    "organization_domain_id": null,
    "is_active": true,
    "blocked_reason": "",
    "last_activity_at": null,
    "login_type": "ALL",
    "sandbox": true
}

HTTP Request

POST /users/(user)/unblock

Parameters

None