Reward Attributes
Rewards consist of a required number of credits (or points), a title and an image or emoji. However, any number of custom Reward Attributes can be created as well. There are, however, some more advanced attributes – such as cost price and a claim limit – and filters. They can also be complemented with custom attributes, which mostly serves integrating purposes, so you might want to keep this in the back of your mind.
List Reward Attributes
Get a list of Reward Attributes.
GET
https://api.piggy.eu/api//reward-attributesHeaders
Authorization
Bearer {{ access_token | api_key }}Accept
application/jsonResponse Example
Show more
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
"data": [
{
"name": "eennaam",
"label": "testNaam ",
"placeholder": "somePlaceholder",
"description": "someOmschrijving",
"type": "boolean",
"fieldType": "default",
"options": [],
"isPiggyDefined": 0,
"isSoftReadOnly": 0,
"isHardReadOnly": 0
},
{
"name": "middle_name",
"label": "Middle name",
"placeholder": null,
"description": "Contact's middle name",
"type": "text",
"fieldType": "text",
"options": [],
"isPiggyDefined": 0,
"isSoftReadOnly": 1,
"isHardReadOnly": 1
},
{
"name": "middle_name1223434",
"label": "Middle name123412312",
"placeholder": "Your middle name",
"description": "Contact's middle name",
"type": "text",
"fieldType": "text",
"options": [],
"isPiggyDefined": 0,
"isSoftReadOnly": 1,
"isHardReadOnly": 1
},
{
"name": "asdfjkl",
"label": "Asfjkl",
"placeholder": "",
"description": "Some description",
"type": "select",
"fieldType": "select",
"options": [
{
"label": "spongebob",
"value": "100"
},
{
"label": "kees",
"value": "200"
}
],
"isPiggyDefined": 0,
"isSoftReadOnly": 0,
"isHardReadOnly": 0
},
{
"name": "something",
"label": "Something",
"placeholder": "",
"description": "Some description",
"type": "select",
"fieldType": "select",
"options": [
{
"label": "spongebob",
"value": "100"
},
{
"label": "kees",
"value": "200"
}
],
"isPiggyDefined": 0,
"isSoftReadOnly": 0,
"isHardReadOnly": 0
}
]
}Create Reward Attribute
Globally create a Reward Attribute for the Account in question.
POST
https://api.piggy.eu/api//reward-attributesHeaders
Authorization
Bearer {{ access_token | api_key }}Accept
application/jsonBody
namestringREQUIREDThe name (internal value) for the attribute.
labelstringOPTIONALThe label for the attribute.
descriptionstringOPTIONALDescription for the attribute.
typestringREQUIREDType of attribute (options: url,
text,date,
phone,
float,
color,
email,
number,
select,
boolean,
rich_text,
date_time,
long_text,
date_range,
time_range,
identifier,
birth_date,
file_upload,
media_upload,
multi_select,
license_plate).
placeholderstringOPTIONALAn additional hint, description, or example of the information required for a particular field.
optionsarrayOPTIONALApplicable for (multi)selects only. Array consisting of label and value objects.
Response Example
Show more
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "middle_name8349",
"label": "Middle name",
"description": "Contact's middle name",
"data_type": "select",
"placeholder": "Your middle name",
"options": [
{
"label" : "Harry",
"value" : 100
},
{
"label" : "SpongeBob",
"value" : 200
},
{
"label" : "Peter",
"value" : 300
}
]
}Code
Message
1003Invalid input.
60009Attribute already exists.
