Push-notifications sending API (deprecated)

Address, identification & format

Attention! This API request is deprecated. please use new Push API

Data is sent to devtodev server at the following address:

https://api.devtodev.com/stat/v1/?api=ak-cDNRQl0Lypq4AOUrx8aGGMnmJT1FSfff

 where:

  • api is the individual devtodev API key of application which can be found on the integration page of the app

  • v1 is the current version of API aggregator 

All data sent should be in UTF8 encoding scheme. 

Send all the content as POST in gzip. The archive should contain the following json.

The size of the sending package before compression should not be higher than 1 megabyte. The packages over 1 megabyte will not be proceeded.  

Only one message can be sent simultaneously. 

{
    "push" : {
        "push_send" :[
            {
                "targets" : [ //array of addressee users
                    { //object with any of addressee user identifiers; ad identifiers are more preferable.
                        //for example:

                        // Push-token. If you use push-token, all fields
                        // with another identifiers will be ignored!
                        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",

                        // Ad identifier IDFA (iOS)                        
                        "idfa" : "XXXXX-XXXXX-XXXXXX-XXXXXX",

                        // Advertising ID (Android, Windows phone 8.1, Windows 8.1/10)
                        "advertisingId" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",

                        // User id. Is applicable if internal identifier / cross-platform user identifier
                        // is used in your app.
                        "customUid": "xxxxxxxxxxxx", 

                        // Device identifier under vendor IDFV (iOS)
                        "idfv" : "XXXXX-XXXXX-XXXX-XXXXX-XXXX", 

                        // AndroidID (Android)
                        "androidId" : "xxxxxxxxxxxxxxxxxxxxxxxxx",

                        // Hardware serial number  (Android, Windows)
                        "serialId" : "xxxxxxxxx"
                    }, 
                    {...} //next addressee data

                ],
                "data" : { //object of notification content 
                    "title" : "Notification title", //notification header; is not used in iOS
                    "text"  : "Notification content", //main text of notification
                    "tag": "campaign name"  //Optional. Campaign name.
                }
            }
        ]
    }
}

Server responses

HTTP Code

Status

413

Wrong size of the package (higher than maximum)

400

Absense of API key

401

Wrong API key

403

Administrative restriction for getting data from the client

400

Unpacking data error

{
	"error_message":"Wrong GZIP format"
}

 

400

Error of JSON format

{
	"error_message":"Wrong JSON format"
}

 

200

Package is accepted

200

Package is accepted, but there are errors of events syntax.

The errors are shown in the following format:

1.

{
    "errors": {
        "pushsend": {
            "expected": "[targets]",
            "received": [
                "[target]",
                "[data]"
            ]
        }
    }
}

Message says that there were fields specified in "received" tag, but there are no fields specified in "expected" tag. This request will not be proceeded.

2.

{
    "errors": {
        "rg": {
            "expected": "[targets]",
            "useless": [
                "[target]",
                "[targeting]"
            ]
        }
    }
}

Message says that there are odd fields specified in "useless" tag. The fields from "expected" tag are enough, and this request will be proceeded.

3. 

{
    "errors": {
        "pushsend": {
            "error":"Message is too long",
            "expected": "1024",
            "received": "1430"
        }
    }
}

Message says that high threshold exceeded. The volume is calculated in bytes after query to push-notification service of the platform. It is nessesary to shorten the header and/or main text by the difference between expected and fact volumes.

Utility

Utility for test of package sending 

https://www.devtodev.com/upload/files/devtodevapitester.jar

Windows UWP
Labels API