Applications

PushExpress -- applications API reference

Version date: 27 July 2024


To authorize, you need to add the header "Authorization: Bearer ..." (get the key by requesting support, it is not yet available in the dashboard).

Creating new application

Request [FireBase]:

curl --url "https://core.push.express/api/b/v1/apps"
    --request POST
    --header "content-type: application/json"
    --header "Authorization: Bearer ..."
    --data '
{
    "push_provider": "firebase",
    "name":"new firebase app",
    "framework": "droid",
    "group_id": 707,
    "link": "http://playmarket.myawesomeapp.com",
    "push_provider_creds": { 
        "type": "service_account",
        "project_id": "g5",
        "private_key_id": "0d09b026404004wc71c658",
        "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgpJteb\n-----END PRIVATE KEY-----\n",
        "client_email": "firebase-viceaccount.com",
        "client_id": "101775676372",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://oauth2.googleapis.com/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "client_x509_cert_url": "https://www.googleapis.com/robot/v1.iam.com",
        "universe_domain": "googleapis.com"
    }
}
'

Request [OneSignal]

curl --url "https://core.push.express/api/b/v1/apps"
    --request POST
    --header "content-type: application/json"
    --header "Authorization: Bearer ..."
    --data '
{
    "push_provider": "onesignal",
    "name":"new onesignal app",
    "framework": "droid",
    "group_id": 707,
    "link": "http://playmarket.myawesomeapp.com",
    "push_provider_creds": {
        "app_id": "onesignal_app_id",
        "api_key": "onesignal_api_key"
    }
}
'

Request [APNS]

curl --url "https://core.push.express/api/b/v1/apps"
    --request POST
    --header "content-type: application/json"
    --header "Authorization: Bearer ..."
    --data '
{
    "push_provider": "apns",
    "name":"new apns app",
    "framework": "swift",
    "group_id": 707,
    "link": "http://playmarket.myawesomeapp.com",
    "push_provider_creds": {
        "apns_topic": "com.example.myapp",
        "apns_team_id": "DEF456GHI",
        "apns_auth_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASC...\n-----END PRIVATE KEY-----",
        "apns_auth_key_id": "ABC123XYZ",
        "apns_prod_cer": "-----BEGIN CERTIFICATE-----\nMIIDdzCCAl+gAwIBAgIJAIkYYz...\n-----END CERTIFICATE-----",
        "apns_dev_cer": "-----BEGIN CERTIFICATE-----\nMIIDdzCCAl+gAwIBAgIJAIkYYz...\n-----END CERTIFICATE-----"
    }
}
'

Body params:

  • push_provider, required. Lowecase, must be one of firebase, onesignal, apns.

  • framework, required. Application type, same as on the website, can only be one of droid, web, swift, flutter, unity.

  • name, required. Application name, any printable characters.

  • push_provider_creds, required. If transport is firebase - you need to insert Firebase Admin SDK IAM key, same as on the website, it must be a valid JSON. If transport is onesignal - you need to provide the key and app ID for OneSignal. If transport is apns - provide the APNS credentials including the topic, team ID and one or both of authentication key, authentication key ID and one or both of production certificate, and development certificate.

  • group_id, optional. Group ID, can be found here https://app.push.express/app/group/ by clicking on the group, the ID will be in the URL. If passed to the request body, the new application will appear in this group and will be added to all schedules where this group is mentioned.

  • link, optional. Link to the Play Market / App Store / etc.

Response:

  • 201: New application created

{
    "app_id": 1234,
    "app_data": {
        "push_provider": "onesignal",
        "name":"new onesignal app",
        "framework": "droid",
        "group_id": 123,
        "link": "http://playmarket.myawesomeapp.com",
        "push_provider_creds":{
            "app_id": "onesignal_app_id",
            "api_key": "onesignal_api_key"
        }
    }
}
  • app_id, int. ID of newly created application.

  • app_data, object. Payload data provided by user in request.

Deleting or archiving application

Deleting means application will be completely deleted from the databases. Archiving means the application will be suspended, it will be removed from any schedule it was mention in, any group or any webmaster, but the appication will still be in the databases, you can always un-archive application using dashboard at https://app.push.express/app/remove/

Request:

curl --url "https://core.push.express/api/b/v1/apps/:app_id"
   --request DELETE
   --header "content-type: application/json"
   --header "Authorization: Bearer ..."
   --data '
{
   "forever": true
}
'

Body params:

  • forever, optional. If you want to completely delete your application - pass true, if you only want to archive application - pass false or nothing at all. By default, if you access endpoint without payload at all - the application will be archived.

Response: 200: Application deleted or archived

{
    "app_id": 1234,
    "status": "archived"
}
  • app_id, int. ID of deleted application.

  • status, string. Could be archived or deleted depending on your request.

Error handling

All HTTP response codes above 400 MUST be considered as error. Most responses with errors will contain information about why it happened. In general, errors do not require attention and do not need to be handled in any way.

Last updated