Deregister Mobile Client

post

/mobile/platform/devices/deregister

Deregisters a mobile client instance that no longer needs to receive notifications.

Permissions

You can access this operation as a social user, a virtual user, an anonymous user, or a mobile user. If you access this operation as a virtual user or a mobile user, then you must have the role that's associated with the mobile backend.

Request

Supported Media Types
Body ()
Root Schema : A mobile client instance.
Type: object
Title: A mobile client instance.
Show Source
  • mobileClient
  • Allowed Values: [ "APNS", "GCM", "FCM", "WNS", "SYNIVERSE" ]
    The notification service the notification token is for.
  • Token needed by the push notification service for sending calls. This token uniquely identifies the specific instance of a mobile application associated with a specific device, and is used to ensure that notifications are sent to the correct recipient. Encode in hexadecimal if necessary.
Nested Schema : mobileClient
Type: object
Show Source
  • Identify the mobile client. This is the application ID that you registered the application with in the mobile backend's Settings tab, such as `com.mycompany.appname`.
  • Allowed Values: [ "IOS", "ANDROID", "WINDOWS", "WEB" ]
    Indicates whether the mobile client is running on iOS, Android, Windows or Web.
Example Request (application/json)
{
    "mobileClient":{
        "id":"com.oracle.myapplication",
        "platform":"IOS"
    },
    "notificationProvider":"APNS",
    "notificationToken":"03767dea-29ac-4440-b4f6-75a755845ade"
}

Response

Supported Media Types

200 Response

The mobile client instance was deregistered successfully, and it will no longer receive notifications.

400 Response

The operation can't be performed due to one of the following reasons:

  • The mobile client ID isn't valid or isn't registered with the mobile backend.
  • The notification provider isn't valid.
  • You used BASIC authorization and the Oracle-Mobile-Backend-ID HTTP request header wasn't specified.
  • The body isn't a correctly formed JSON object or a required property is missing.
Headers
Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Example Response (application/json)
{
    "o:errorCode":"MOBILE-58060",
    "detail":"Unable to use API virtualization for calls without any Mobile Backend context.",
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Cannot call API",
    "o:errorPath":"/mobile/platform/devices/deregister",
    "o:ecid":"cde040005cd5983e:4372d958:14c8c4c2d6c:-8000-000000000032b9d5, 0",
    "status":400
}

401 Response

User is unauthorized to perform this call. This can happen due to one of the following reasons:

  • The user doesn't exist.
  • The password is incorrect.
  • The credentials weren't encoded using the RFC2045-MIME variant of Base64.
  • The Authorization HTTP request header wasn't specified.
Headers
Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Example Response (application/json)
{
    "o:errorCode":"MOBILE-15209",
    "detail":"401 - Unauthorized",
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Unauthorized",
    "o:errorPath":"/mobile/platform/devices/deregister",
    "o:ecid":"cde040005cd5983e:4372d958:14c8c4c2d6c:-8000-000000000033b51c, 0",
    "status":401
}

404 Response

The operation cannot be performed due to one of the following reasons:

  • The active mobile backend cannot be found.
  • The mobile client ID cannot be found. Either it does not exist or it was deregistered.
Headers
Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Example Response (application/json)
{
    "o:errorCode":"MOBILE-58026",
    "detail":"We cannot find the active mobile backend for the given clientId fd4cc0cf-0a72-4ed6-aab6-295133b8904e and BASIC schema. Specify a valid clientId and try again.",
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Mobile Backend not found",
    "o:errorPath":"/mobile/platform/devices/deregister",
    "o:ecid":"cde040005cd5983e:4372d958:14c8c4c2d6c:-8000-000000000033b529, 0",
    "status":404
}

415 Response

The MIME media type isn't supported or was not specified. Only application/json is supported.

Headers
Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by the service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Example Response (application/json)
{
    "o:errorCode":"MOBILE-92515",
    "detail":"The MIME media type isn't supported. Only application/json is supported. Specify a media type that is supported.",
    "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Unsupported media type",
    "o:errorPath":"/mobile/platform/devices/deregister",
    "o:ecid":"cde040005cd5983e:4372d958:14c8c4c2d6c:-8000-000000000033ba73, 0",
    "status":415
}

Examples

The following example shows how to deregister an instance of a mobile app on a mobile device by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.

curl -i
-X POST 
-u mobile.user@example.com:password
-d @deregister.json
-H "Content-Type: application/json; charset=utf-8"
-H "Oracle-Mobile-Backend-ID: ABCD9278-091f-41aa-9cb2-184bd0586fce"
https://fif.cloud.oracle.com/mobile/platform/devices/deregister

Example of Request Body

The following shows an example of the request body. The values match the values that were used when the mobile app was registered with the mobile backend.

{
  "notificationToken": "b14d6dfbd9d56e09f098",
  "mobileClient": {
    "id": "my.app.id",
    "platform": "IOS"
  }
}

Example of Response Header

The following shows an example of the response header:

200 OK
Date: Wed, 17 Jun 2015 18:30:48 GMT
Oracle-Mobile-Runtime-Version: 15.4.1-201506162222