A small catalog of sample queries (often used)
All the valid offers...
Basic request to retrieve a list of all the coupons, available for publication, and valid after the 1st of January 2014
{
"Campaign":{
"publishable":"1",
"dateValidUntil_ge":"2014-01-01 00:00:00",
"messageType":"Coupon"
}
}
All the offers with geofencing
Published and valid after 01/01/2014 of 'MODE' shop (clothes, etc...) area near the 48.8,2.35 location
{
"Campaign":{
"publishable":"1",
"dateValidUntil_ge":"2014-01-01 00:00:00",
"messageType":"Coupon",
"group":{
"tags_contains":"MODE",
"address":{
"clat_near":"48.8:3",
"clong_near":"2.35:3"
}
}
}
}
All the shops of my network
Simple request, all the shops (type M) below me
{
"Group":{
"type":"M"
}
}
All the shops (type=M), near some coordinate, in the MODE (tags)
{
"Group":{
"type":"M",
"tags_contains":"MODE",
"address":{
"clat_near":"48.8:3",
"clong_near":"2.35:3"
}
}
}
Create a coupon on a campaign
Once you have identified a member and a campaign. You can enable him/her to create a coupon on this campaign
{
"Sent" :{
"type" : "COUPON",
"message" : "here you can add a message, that will be visible in the custoemr history",
"member" : {
"id" : "put here the member id"
},
"campaign" : {
"id" : "here the campaign id retrieved from an offer list, see up"
}
}
}
Retrieve all SchedulerEntry available for a group
Once you have got the group, you can retrieve all its SchedulerEntry, for a period between DATE1 and DATE2
{
"CompactSchedulerEntry":{
"pr":{
"group":{"id":"put the group id"}
},
"dtstart_le":"DATE2",
"or": {
"dtstart_ge":"DATE1",
"dateRepeat_ge": "DATE2"
},
"dtend_le":"DATE2",
"typeRepeat_not":"hidden"
}
}
Retrieve all SchedulerResa available for a member on my group
Once you have identified a member, you can retrieve all his SchedulerResa
{
"SchedulerResa":{
"member":{
"id":"put the member id"
},
"entry": {
"pr": {
"group": {
"id": "put the group id"
}
}
}
}
}
Create a SchedulerResa on a member
Once you have identified a member, you can create a SchedulerResa on a previously retrieved SchedulerEntry
{
"SchedulerResa": {
"member": {
"id":"put the member id"
},
"entry":{
"id": "put the SchedulerEntry id"
},
"group":{
"id": "put the Group id"
},
"type": "schedulerResa",
"comment": "Comment on this Scheduler Resa (generally SchedulerEntry.summary)",
"participationStatus": "STATUS (reserve, pending, cancel)",
"univers": "Schedule",
"startDate": "SchedulerEntry.dtstart",
"endDate": "SchedulerEntry.dtend"
}
}
Create a GiftCard on a member
Once you have identified a member, you can create a GiftCard
{
"GiftCard": {
"member": {
"id":"put the member id"
},
"idExternal": "External ID on your system",
"group": {
"id": "put the Group ID where the GiftCard is create"
},
"credit": "Credit's number on this card",
"giftCardProgramCode": "Code identifying cards",
"brief": "Description of this card",
"startDate": "Begin date of this card",
"endDate": "End date of this card",
"cardnumber": "Card Number generally write on the card's front",
"cvv2": "Card Verification Value generally write on the card's back",
"activationCode": "The activation code for this card"
}
}
Make actions on a GiftCard
Once you have identified a GiftCard, you can create a GiftCardEvent in order to change status
{
"GiftCardEvent": {
"card": {
"id": "put the GiftCard id"
},
"type": "STATUS",
"comment": "put a comment on this event for the activation of the card",
"sparam": "ACTIVE",
}
}
Once you have identified a GiftCard, you can create a GiftCardEvent in order to use credits
{
"GiftCardEvent": {
"card": {
"id": "put the GiftCard id"
},
"type": "addDebit",
"comment": "put a comment on this event for the utilisation of X credits",
"fvalue": "X credits use by this event"
}
}
Does this card exist ?
Simple request in order to check if the given card is provisionned on Adelya's database
{
"FidelityCard": {
"cardnumber": "123456789"
}
}