Applications
Version date: 8 October 2024
To authorize, you need to add the header
"Authorization: Bearer ..."
(get your API KEY in your personal account on "Personal" tab).
Endpoints
Create an App
POST https://core.push.express/api/b/v2/apps
Description: Creates a new app.
Request [Firebase]:
Request [Onesignal]:
Request [APNs]:
Body params:
push_provider
, required. Lowecase, must be one offirebase
,onesignal
,apns
.name
, required. Application name, any printable characters.push_provider_creds
, required. If transport isfirebase
- you need to insertFirebase Admin SDK IAM key
, same as on the website, it must be a valid JSON. If transport isonesignal
- you need to provide the key and app ID for OneSignal. If transport isapns
- provide the APNS credentials including the topic, team ID, authentication key and authentication key ID.link
, optional. Link to the Play Market / App Store / etc.
Response:
201: New application created
id
, int. ID of newly created application.
If an application has successfully been created then it was automatically added to groups and schedulers which are set to include all apps.
List Apps
GET https://core.push.express/api/b/v2/apps
Description: Retrieves a list of all apps
No more then 10000 records can be returned
Request
Query parameters:
archived
, bool, optional. Filters archived apps if true, otherwise returns active apps.
Response:
200: List of applications retrieved
If user does't own any applications yet then response is an empty list.
id
, int. ID of application.push_provider
,name
,link
see Create an App.groups
, json. List of all groups that include current app. If an app is not included into any group thengroups
is an empty list.
PushExpress provides an opportunity to add applications to groups. Full list of groups one owns can be observed here (authentification required).
has_firebase_creds
,has_apns_creds
,has_onesignal_creds
, bool. True if all components of corresponding credentials are not empty. False if any component missed. List of creds components for each provider type see in Create an App.archived
, bool. True if app archived, false otherwise.
Get an App
GET https://core.push.express/api/b/v2/apps/:app_id
Description: Retrieves details of a specific app by its ID.
Request
Response:
200: Application info retrieved
Details on response can see in List Apps
Archive an App
POST https://core.push.express/api/b/v2/apps/:app_id/archive
Description: Archives a specific app by its ID. This actions is idempotent, i.e. double archiving is valid.
Request
Response:
204: No content
If an application has successfully been archived then it was automatically removed from all groups and schedulers.
Delete an App
DELETE https://core.push.express/api/b/v2/apps/:app_id
Description: Deletes a specific app by its ID.
Request
Response:
204: No content
If an application has successfully been deleted then it was automatically removed from all groups and schedulers.
Restore an App (Not implemented yet)
POST https://core.push.express/api/b/v2/apps/:app_id/unarchive
Description: Restores a specific app by its ID. This actions is idempotent, i.e. double unarchiving is valid.
Request
Response:
204: No content
To restore an application does NOT mean to restore all devices it had in the very same moment. Devices will be restored only through a process of syncronization or sdk activity.
Update an App
PUT https://core.push.express/api/b/v2/apps/:app_id
Description: Updates the base information of a specific app by its ID.
Request:
Response:
204: No content
Update Credentials And Push Provider
PUT https://core.push.express/api/b/v2/apps/:app_id/creds/:push_provider
Description: Updates both credentials and push provider for a specific app.
Request [Firebase]:
Request [Onesignal]:
Request [APNs]:
Response:
204: No content
Error handling
All HTTP response codes 2xx SHOULD be considered as success. Requested action was executed successfully.
All HTTP response codes above 400 MUST be considered as error. Requested action failed. Retries policy should be hold according to HTTP specification.
Common API errors:
400 - request error. Request has invalid data. Check you request (url, headers, payload)
401 is returned when provided API token is invalid. Check your authentification data.
404 is returned when resource doesn't exist. Check your request data.
Example: PUT
https://core.push.express/api/b/v2/apps/:app_id
returns 404 when providedapp_id
doesn't existAll HTTP response codes 5xx - other errors from proxy servers, load balancers, etc. There may or may not be some explanation in response body. These errors always require retries.
API errors have content-type: application/json
header and json response body
Example: {"error": "validation error: ...", "req_id":"<string>"}
Response parameters:
req_id
string is a request ID. It is used by for problem solving, please, provide it to support if problem emerged.error
object, describing errors.
Non-API errors like 502, 504, etc., may or may not include a description.
Last updated