Recommendations
Getting recommendations with Matchable's API is really simple.
Recommendations are strings that trigger actions in your game. You can define their value in the dashboard.
-
Getting recommendations with curl
Here’s an example of request with curl:
curl -X GET --header 'Accept: application/json' 'http://api.matchable.io/v1.0/users/<user_id>/recoms'
Here’s an example of callback you will get:
{ "user_id": "<user_id>", "recoms": [ "give_gold_50", "show_popup_ad1" ] }
In that example, Matchable's recommendations are showing one advertisment popup and give some gold as a bonus
To see examples of requests or any other detail regarding the current API, please refer to the online documentation.
-
Getting recommendations with Unity
To facilitate this integration, Matchable provides a SDK for the Unity framework:
https://github.com/Matchable/matchable-unity-sdkHere’s an example of request with Unity:
public IEnumerator DemoGetRecommendations() { _test = "Matchable.GetRecommendations()"; _log = "Waiting for response..."; // Call GetAdvisor asynchronously as a Coroutine yield return StartCoroutine(Matchable.GetRecommendations((response) => { // Handle the API response the way you want _log = response.ToJsonString(); // Ex: get the recoms value _log += "\n\nRecoms: " + response.GetValue("recoms"); })); }
Now all you need is to parse the "recoms" value to process ingame actions.