Skip to content

Instantly share code, notes, and snippets.

@matzew
Last active December 18, 2015 09:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/73ec38d853863e7bb1dd to your computer and use it in GitHub Desktop.
Save matzew/73ec38d853863e7bb1dd to your computer and use it in GitHub Desktop.
REST APIs for AeroGear UnifiedPush Server

REST API for AeroGear UnifiedPush Server

The functionality described in the Server-Side specification is backed by these RESTful endpoints:

AUTH (endpoint) info added soon-ish

APIs for working with PushApplication

Registration of a PushApplication (HTTP POST)

http://server:port/context/rest/applications
Success status code and returned body
  • HTTP/1.1 201 Created The Body will contain (JSON) details about the created PushApplication

Failure status code and desciption
  • HTTP/1.1 400 Bad Request The format of the client request was incorrect (e.g. missing required values).

  • HTTP/1.1 401 Unauthorized The request requires authentication.

Read all PushApplications (HTTP GET)

http://server:port/context/rest/applications
Success status code and returned body
  • HTTP/1.1 200 OK The Body will contain a JSON list of the PushApplications.

Failure status code and desciption
  • HTTP/1.1 401 Unauthorized The request requires authentication.

Read a specific PushApplication (HTTP GET)

http://server:port/context/rest/applications/{PUSH_APP_ID}
Success status code and returned body
  • HTTP/1.1 200 OK The Body will contain (JSON) details about the PushApplication

Failure status code and desciption
  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource does not exist.

Update a specific PushApplication (HTTP PUT)

http://server:port/context/rest/applications/{PUSH_APP_ID}
Success status code and returned body
  • HTTP/1.1 204 No Content Empty body.

Failure status code and desciption
  • HTTP/1.1 400 Bad Request The format of the client request was incorrect (e.g. missing required values).

  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource does not exist.

Delete a specific PushApplication (HTTP DELETE)

http://server:port/context/rest/applications/{PUSH_APP_ID}
Success status code and returned body
  • HTTP/1.1 204 No Content Empty body.

Failure status code and desciption
  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource does not exist.

APIs for working with Mobile Variant(s)

The following MobileVariants are supported

  • iOS

  • android

  • simplePush

The above writing matches the {variantName} in belows URLs

Registration of a MobileVariant (HTTP POST)

For the iOS variant, the MediaType is multipart/form-data.

http://server:port/context/rest/applications/{PUSH_APP_ID}/{variantName}
Success status code and returned body
  • HTTP/1.1 201 Created The Body will contain (JSON) details about the created MobileVariant

Failure status code and desciption
  • HTTP/1.1 400 Bad Request The format of the client request was incorrect (e.g. missing required values).

  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource (PushApplication) does not exist.

Read all MobileVariants for a PushApplication (HTTP GET)

http://server:port/context/rest/applications/{PUSH_APP_ID}/{variantName}
Success status code and returned body
  • HTTP/1.1 200 OK The Body will contain a JSON list of the MobileVariants.

Failure status code and desciption
  • HTTP/1.1 401 Unauthorized The request requires authentication.

Read a specific MobileVariants (HTTP GET)

http://server:port/context/rest/applications/{PUSH_APP_ID}/{variantName}/{variantID}
Success status code and returned body
  • HTTP/1.1 200 OK The Body will contain (JSON) details about the MobileVariant

Failure status code and desciption
  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource (MobileVariant) does not exist.

Update a specific MobileVariant (HTTP PUT)

For the iOS variant, the MediaType is multipart/form-data.

http://server:port/context/rest/applications/{PUSH_APP_ID}/{variantName}/{variantID}
Success status code and returned body
  • HTTP/1.1 204 No Content Empty body.

Failure status code and desciption
  • HTTP/1.1 400 Bad Request The format of the client request was incorrect (e.g. missing required values).

  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource (MobileVariant) does not exist.

Delete a specific MobileVariant (HTTP DELETE)

http://server:port/context/rest/applications/{PUSH_APP_ID}/{variantName}/{variantID}
Success status code and returned body
  • HTTP/1.1 204 No Content Empty body.

Failure status code and desciption
  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource (MobileVariant) does not exist.

Device Registration (HTTP Post)

http://server:port/context/rest/registry/device
Success status code and returned body
  • HTTP/1.1 200 OK On successful storage of the device related metadata.

Failure status code and desciption
  • HTTP/1.1 400 Bad Request The format of the client request was incorrect (e.g. missing required values).

  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource (PushApplication or MobileVariants) does not exist.

Sender API

Broadcast (HTTP POST)

http://server:port/context/rest/sender/broadcast
Success status code and returned body
  • HTTP/1.1 200 OK Indicates the Job has been accepted and is being process by the AeroGear UnifiedPush Server.

Failure status code and desciption
  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource (PushApplication or MobileVariants) does not exist.

Selective Send (HTTP POST)

http://server:port/context/rest/sender/selected
Success status code and returned body
  • HTTP/1.1 200 OK Indicates the Job has been accepted and is being process by the AeroGear UnifiedPush Server.

Failure status code and desciption
  • HTTP/1.1 401 Unauthorized The request requires authentication.

  • HTTP/1.1 404 Not Found The requested resource (PushApplication or MobileVariants) does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment