Some Frequently Asked Question

I'd like to create a prospect rather than a client

Set the type to 'P' when persisting a FidelityMember


{
        "FidelityMember":{
          "name":"Doe",
          "mobile":"0664208629",
          "type":"P"
 }
} 
			

I just persist a member with a mobile, and do not get it back on a search query...

The Platform automatically store phone number according to the Int. telecom Std. You probably are making a search only with the local number (without international prefix). You can circumvent this by using the contains operator.
Exemple with french mobile phone : you store 060102030405, it becomes +3360102030405. So below in the example we search on the 60102030405 part.


{
        "CompactFidelityMember":{
          "name":"Doe",
          "mobile_contains":"60102030405"
 }
} 
			

Can I get only the Member info, without all the events ?

Sure ! We have a simplified object for that : CompactFidelityMember


{
        "CompactFidelityMember":{
          "name":"Doe",
          "mobile_contains":"664208629"
 }
} 
			

Can I get all the event of a member of a given type ?

Request to "Show" all the events such that event=xxx (addPoint in the example)


{
        "AdEvent" : {
                "type":"addPoint",
                "member" : {"id": "here the member id"}
        }
}
			

If you are interested only in coupons/messages use the Sent object (which is a subclass of AdEvent)


{
        "Sent" : {					
                "member" : {"id": "here the member id"}
        }
}
		 

Can I get more debug info ?

If feel that the error is not verbose enought, you may try the following parameter addition to the url to have the error stacktrace :


			printStackTrace=true
			

hence the complete url will be :

			
			https://{server}/apiv1/webapi.do?printStackTrace=true&json_header={...}&json_data={}
			

JSon api is overkill, I use csv file instead

Guess what, you are not the first one to say that. Ok, follow this link, lots of wonders await you :
CSV import process.
To sum it up, if you are able to produce a CSV file and put the property name as column header, you'll be able to upload a batch of create and update request on the api.

I do not trust my connection, how can I check you are reachable

It is indeed a good pattern to monitor your external ressources. We provide a heartbeat url that check if the servel is alive and respoding without overloading it.

https://{server_name}/loyaltyoperator/isup.do

How can I cancel an event (Sale, coupon, etc...)

The general answer is: issue an HTTP DELETE request on you object (with an id or using loadfromkeys operator). eg:


				HTTP DELETE
				{
					"AdEvent":{
							"loadFromKeys": { "idExternal":"427583854679"} 
					}
				}
			

This will set status1=1 and set the dateStatus1 to now.

But in some cases, especially for money related events, you do not want that an event disappears from your list and reports, you would prefer to create a sibling negative event.
Eg. for an {AdEvent :{"type":"addCA","fvalue":100} you will persist a {AdEvent :{"type":"addCA, "fvalue":-100}}

I run a DELETE, but my data is still there

There is no explicit delete on our platform.

All objects have many inter relations, and it is not usually possible to just delete an object. More over for history searches and legal aspects, we must be able to track who has done what, and what was done or sent via our platform to a customer. Deleting en object would conflict with this need.

Instead of deleting an object, you should consider setting the archive property to true and dateValidUntil to the date of termination (if those properties exist of course...)

If you think nevertheless that an object must be deleted, please send a message to our support.

Do idExternal must be unique ?

Lot's (most of) our business object have an idExternal for you to store you unique key, and then use this in query. We highly recommend that this key is a unique one but we do not enforce this. So it's your responsability. If it is not unique, you'll not be able to use it with the loadFromKeys operator. This may change in future version but for now it's your job.

I'd like to count the number of xxx

Yes you can, proceed as for a search, but add the parameter action=count to your request.

curl example : curl --user '{APIKEY};{user}:{pass}' --data 'action=count&format=JSON&json_data={"FidelityMember":{"name_starts_with":"test"}}'https://qa.adelya.com/apiv1/webapi.do return is {"ApiReturn":{"code":"OK","message":"107"}}