Device API (Custom Fields, Tags and Alias)

Overview

The following document describes the actions you can perform on a device level using the server to server API:

  • Setting Alias using Device ID (ADID (iOS) / Device ID (Android))
  • Setting Tags using Alias /  Device ID
  • Setting Custom Fields (String, numeric and Date) using Alias / Device ID
  • Get fields using device ID 


The above requests supports setting of multiple devices in a single request when using alias.


Request URL

The following request is asynchronous, as such a response of "200" ok indicates that the request was submitted successfully.  

PUT 

https://saas.appoxee.com/api/v3/device

Request Header

The request header must include the following authentication parameters, used to log into Appoxee:

Name
Value
X_KEY

Your Appoxee app SDK key


Example Request


Set/remove tags by alias 
{
    "alias":"danny",
    "actions":
        {
            "tags": {
                "set": ["tag1", "tag2"],
                "remove": ["tag3", "tag4"]
           }
        }
}


Set/remove tags by alias to multiple devices
{
    "alias":["danny","john","lucas"],
    "actions":
        {
            "tags": {
                "set": ["tag1", "tag2"],
                "remove": ["tag3", "tag4"]
           }
        }
}


Set fields by alias 


 {
    "alias":"danny",
    "actions":
        {
            "set": {
                        "num_of_purchases": 4,
                        "money_spent": 1,
                        "user_name": "danny",
                        "user_birthday": "1975-02-22T00:00:00"
            }
        }
}


Set fields by alias for multiple devices ( up-to 1000 aliases per call)


 {
    "alias":["danny","john","lucas"],
    "actions":
        {
            "set": {
                        "num_of_purchases": 4,
                        "money_spent": 1,
                        "user_name": "danny",
                        "user_birthday": "1975-02-22T00:00:00"
            }
        }
}


Increment fields by alias 


{
    "alias":"danny",
    "actions":
        {
            "inc": {
                        "num_of_purchases": 4,
                        "money_spent": 1
            }
        }
} 


Increment fields by alias for multiple devices ( up-to 1000 aliases per call)


{
    "alias":["danny","john","lucas"],
    "actions":
        {
            "inc": {
                        "num_of_purchases": 4,
                        "money_spent": 1
            }
        }
} 


Set alias by adid (aka Appoxee Device ID)


 {
    "key":"898cfd56-7516-4248-aab1-6d14d2ceb355",
    "actions":
        {
            "set": {
                        "alias": "xxxx"
                        }
        }
}


Set/remove tags by adid (aka Appoxee Device ID)
 {
    "key":"898cfd56-7516-4248-aab1-6d14d2ceb355",
    "actions":
        {
            "tags": {
                "set": ["tag1", "tag2"],
                "remove": ["tag3", "tag4"]
           }
        }
}


Set fields by adid (aka Appoxee Device ID) 


{
    "key":"898cfd56-7516-4248-aab1-6d14d2ceb355",
    "actions":
        {
            "set": {
                        "num_of_purchases": 4,
                        "money_spent": 1,
                        "user_name": "danny",
                        "user_birthday": "1975-02-22T00:00:00"
            }
        }
} 


Increment fields by adid (aka Appoxee Device ID)


 {
    "key":"898cfd56-7516-4248-aab1-6d14d2ceb355",
    "actions":
        {
            "inc": {
                        "num_of_purchases": 4,
                        "money_spent": 1
            }
        }
}


Get fields by adid (aka Appoxee Device ID)


 {
    "key":"898cfd56-7516-4248-aab1-6d14d2ceb355",
    "actions":
        {
            "get": ["alias","tags"]
        }
}

HTTP Response Header

HTTP Header Field
Value
Status Code
  • Upon success – 200 OK 
  • Upon failure – the failure status code (for example: "400 Bad Request")

HTTP Response Body

Please ignore the response body as it is irrelevant