NAV
shell ruby python csharp php

IDCardTemplate

The IDCardTemplate object

The IDCardTemplate object looks like this in JSON:

{
    "object": "id_card_template",
    "id": 1,
    "type": "ID_CARD",
    "sub_type": "STUDENT",
    "name": "Student",
    "num_rows": 1,
    "num_columns": 1,
    "row_spacing": 0,
    "column_spacing": 0,
    "page_margin_top": 0,
    "page_margin_left": 0,
    "page_width": 3.37,
    "page_height": 2.125,
    "one_cell_per_page": true,
    "cell_width": 3.37,
    "cell_height": 2.125,
    "cell_to_start_printing_on": 1,
    "status": "active",
    "is_default": true,
    "added_at": "2015-08-12T05:41:29+00:00",
    "added_by_id": 3483127,
    "updated_at": "2016-11-30T08:09:44+00:00",
    "updated_by_id": 7011453,
    "sandbox": true
}
Attribute Required Data Type
id Yes int
type Yes text (50)
sub_type No text (50)
name Yes text (255)
num_rows Yes int
num_columns Yes int
row_spacing Yes decimal
column_spacing Yes decimal
page_margin_top Yes decimal
page_margin_left Yes decimal
page_width Yes decimal
page_height Yes decimal
one_cell_per_page Yes bool
cell_width Yes decimal
cell_height Yes decimal
cell_to_start_printing_on Yes int
status Yes enum (active, deleted)
is_default Yes bool
added_at No datetime
added_by_id No int
updated_at No datetime
updated_by_id No int
sandbox No bool

index

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/idcardtemplates" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/idcardtemplates',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/idcardtemplates',
 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/idcardtemplates"), 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/idcardtemplates');
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": 1,
    "results": 1,
    "results_per_page": null,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "id_card_template",
            "id": 1,
            "type": "ID_CARD",
            "sub_type": "STUDENT",
            "name": "Student",
            "num_rows": 1,
            "num_columns": 1,
            "row_spacing": 0,
            "column_spacing": 0,
            "page_margin_top": 0,
            "page_margin_left": 0,
            "page_width": 3.37,
            "page_height": 2.125,
            "one_cell_per_page": true,
            "cell_width": 3.37,
            "cell_height": 2.125,
            "cell_to_start_printing_on": 1,
            "status": "active",
            "is_default": true,
            "added_at": "2015-08-12T05:41:29+00:00",
            "added_by_id": 3483127,
            "updated_at": "2016-11-30T08:09:44+00:00",
            "updated_by_id": 7011453
        }
    ],
    "sandbox": true
}

Retrieves all IDCardTemplate objects.

HTTP Request

GET /idcardtemplates

Parameters

None

Expandable Properties

Permissions

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

Export (person)

curl "https://yourschool.populiweb.com/api2/people/(person)/idcard" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/people/(person)/idcard',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/people/(person)/idcard',
 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/people/(person)/idcard"), 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/people/(person)/idcard');
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:

{}

Either id_card_template_id or print_layout_id is required.

HTTP Request

GET /people/(person)/idcard

Parameters

Name Required Data Type Description
id_card_template_id No int
print_layout_id No int

Permissions

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

index (PrintLayouts)

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/idcardtemplates/printlayouts" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/idcardtemplates/printlayouts',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/idcardtemplates/printlayouts',
 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/idcardtemplates/printlayouts"), 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/idcardtemplates/printlayouts');
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": 1,
    "results": 1,
    "results_per_page": null,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "print_layout",
            "id": 7,
            "name": "Standard Student ID",
            "print_layout_type_id": 24,
            "active_revision": null,
            "default": true,
            "template_type": "html",
            "content": null,
            "subtype": "STUDENT",
            "added_at": "2024-05-06T22:07:20+00:00",
            "added_by_id": 1257
        }
    ],
    "sandbox": true
}

Retrieves all IdCardTemplate objects.

HTTP Request

GET /idcardtemplates/printlayouts

Parameters

None

Permissions

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