如何使用 CleverTap API 使用 python 发送推送



我正在将我的 Parse 推送通知数据迁移到 CleverTap。我遇到的问题是文档不是很好,他们给出的示例不包括推送通知。

有人有一个例子说明如何使用Python使用CleverTap API发送推送,或者至少有证据表明这是可能的?

文档现在介绍如何将 Parse 安装迁移到 CleverTap。例如,假设我们正在创建一个推送通知,以发送给订阅"洋基队"和"mets"频道的用户。

curl -H "Content-Type:application/json"
 -H "X-CleverTap-Account-ID: Your CleverTap Account ID"
 -H "X-CleverTap-Passcode: Your CleverTap Account Passcode"
 --data "@payload"
 "https://api.clevertap.com/1/targets/create.json"

有效载荷

"name": "My API Campaign",
"where": {
    "common_profile_prop": {
        "profile_fields": [
            {
                "name": "channels",
                "value": ["yankees", "mets"]
            }
        ]
    }
},
"content":{
    "title": "Breaking News",
    "body": "Yankees Win 5-4",
    "platform_specific": {
        "ios": {
            "deep_link": "example.com",
            "sound_file": "example.caf",
            "category": "reactive",
            "badge_count": 1,
            "key": "value_ios"
        },
        "android": {
            "background_image": "http://example.jpg",
            "default_sound": true,
            "deep_link": "example.com",
            "key": "value_android"
        }
    }
},
"devices": [
    "android",
    "ios",
],
"when": "now"
}

响应

{
"status": "success",
"id": 1457433898,
"estimates": {
    "android": 90,
    "ios": 300
}
}

希望这有帮助。更多文档可以在这里找到 -https://github.com/CleverTap/parse-migrate

最新更新