NAV
shell ruby python csharp php

Appeal

The Appeal object

The Appeal object looks like this in JSON:

{
    "object": "appeal",
    "id": 1,
    "campaign_id": 1,
    "name": "Email blast #20",
    "appeal_medium_id": 3,
    "made_on": "2014-04-05",
    "cost": 50,
    "status": "inactive",
    "added_at": "2014-04-04T23:27:05+00:00",
    "added_by_id": 1257,
    "sandbox": true
}
Attribute Required Data Type
id Yes int
campaign_id Yes int
name Yes text (200)
appeal_medium_id No int
made_on Yes date
cost No decimal
status Yes enum (active, inactive, deleted)
added_at No datetime
added_by_id No int
sandbox No bool

index

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/appeals" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/appeals',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/appeals',
 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/appeals"), 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/appeals');
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": 5,
    "results": 5,
    "results_per_page": null,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "appeal",
            "id": 1,
            "campaign_id": 1,
            "name": "Email blast #20",
            "appeal_medium_id": 3,
            "made_on": "2014-04-05",
            "cost": 50,
            "status": "inactive",
            "added_at": "2014-04-04T23:27:05+00:00",
            "added_by_id": 1257
        }
    ],
    "sandbox": true
}

Retrieves all Appeal objects.

HTTP Request

GET /appeals

Parameters

None

Permissions

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

show

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/appeals/(appeal)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/appeals/(appeal)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/appeals/(appeal)',
 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/appeals/(appeal)"), 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/appeals/(appeal)');
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": "appeal",
    "id": 1,
    "campaign_id": 1,
    "name": "Email blast #20",
    "appeal_medium_id": 3,
    "made_on": "2014-04-05",
    "cost": 50,
    "status": "inactive",
    "added_at": "2014-04-04T23:27:05+00:00",
    "added_by_id": 1257,
    "sandbox": true
}

Retrieves a specific Appeal object.

HTTP Request

GET /appeals/(appeal)

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: