Java client API or CURL command for Inactivity trigger?

Hi All,

I was unable to find Java client API or CURL command for Inactivity trigger.
Can any one provide the Java API and curl command for Inactivity trigger.

Didn't find what you were looking for?

New post

Comments

1 comment

  • Hi Chnakaya, 

    While the automation API isn't currently supported by the Java library, you can create a cURL command for an inactivity trigger. An inactivity trigger is a historical object, which you can find more information about here: 

    http://docs.urbanairship.com/api/ua.html#historical-trigger-object

    The complete cURL command would look something like this: 

    curl https://go.urbanairship.com/api/pipelines \
       -X POST \
       -u "<AppKey>:<MasterSecret>" \
       -H "Accept: application/vnd.urbanairship+json; version=3" \
       -H "Content-Type: application/json" \
       -d '{
              "name": "inactive",
              "enabled": true,
              "historical_trigger": { "event": "open", "equals": 0, "days": 30 },     
              "outcome": {
                 "push": {
                    "audience": "triggered",
                    "notification": { "alert": "Whatever you would like to say here" },
                    "device_types": "all"
                 }
              }
           }'

    This particular command creates an inactivity trigger that sends a notification if a user hasn't opened your application in thirty days, but you can specify it to be anywhere up to 90 days. For more examples of API requests, you can view this topic guide: http://docs.urbanairship.com/topic-guides/api-examples.html#automation. I hope this helps!

    Comment actions Permalink
    0

Please sign in to leave a comment.