App Uninstall URL endpoint

This endpoint is invoked by AMS on application uninstall. This topic explains the request that AMS sends when apps are uninstalled. For full details about the uninstallation process, see App Installation.

Service URL

<app-base-url><app-uninstall-url>

These URLs are registered with AMS when creating an app.

Request Method

POST

Request Header

Authorization: Bearer <JWT>

Content-Type=application/json

Bearer Token

Claims

In the case where it is AMS making the request to the app, the key and value pairs bear the following meanings:

Key Value Definition Context
iss The issuer of the token. The App's Token Key.
sub The subject of the token. Set to the app's associated product uuid.
aud The audience of the token. The App's Token Key.
exp The date and time the token will expire, expressed as a Unix timestamp. Must be after the current date/time. Set to 60 seconds after the JWT was created.
iat The date and time the JWT was issued, expressed as a Unix timestamp. Set to the current time.
jti The unique identifier for the JWT token Set to a random UUID
o.a.p.csourceRequest The source of the request Set to the app's associated product uuid.
o.a.p.cdestinationId The destination Id Set to the app's UUID. Found in app details.
o.a.p.cdestinationUrl The destination URL The destination URL is the app's base URL + the app's install URL. These URLs are found in app details.

Signature

Signed with an app's install secret.

Sample JWT Payload

In order to authenticate with the app, AMS constructs a JWT payload using the information details about the app (e.g application uuid, application token key, product affinity, etc). AMS then sign's the JWT using the application's install secret.

Below is an example JWT payload that AMS uses to call the application uninstall endpoint:

 {
  "iss": "4701447f-20f1-4a25-875f-52e36d6a93ae",
  "sub": "234501ff-4757-49a0-9d09-a88f5ce8ad35",
  "aud": "4701447f-20f1-4a25-875f-52e36d6a93ae",
  "exp": 1540930341,
  "iat": 1540930281,
  "jti": "76eab847-95cf-4e21-b68c-77e6a434b2ab",
  "o.a.p.csourceRequest": "234501ff-4757-49a0-9d09-a88f5ce8ad35",
  "o.a.p.cdestinationId": "c1fce274-09c5-457a-a916-141de834b4cd",
  "o.a.p.cdestinationUrl": "http://localhost:8090/appInstalls/uninstall"
} 

Sample Request Body

{
  "uuid": "fc2ac441-8217-4273-b60d-c9956b5b7bef",
  "deleted": 0,
  "application": {
    "baseUrl": "http:\/\/localhost:8090",
    "configureUrl": "http:\/\/localhost:8090\/configuration.jsp",
    "description": "Sample App",
    "deleted": 0,
    "installUrl": "appInstalls\/install",
    "largeLogo": "https:\/\/images.freeimages.com\/images\/large-previews\/2fe\/butterfly-1390152.jpg",
    "mediumLogo": "https:\/\/images.freeimages.com\/images\/large-previews\/2fe\/butterfly-1390152.jpg",
    "name": "Sample App",
    "saveConfigurationUrl": "appInstalls\/configuration",
    "smallLogo": "https:\/\/images.freeimages.com\/images\/large-previews\/2fe\/butterfly-1390152.jpg",
    "status": "UP",
    "publicationStatus": "DEVELOPMENT",
    "statusMessage": {
      "body": "O",
      "eta": 978309000000,
      "reason": "Someone"
    },
    "statusUrl": "status",
    "uninstallUrl": "appInstalls\/uninstall",
    "uuid": "7e1da507-f54a-4a21-8ac2-cf7a8e9ae7ee",
    "providerUuid": "15e2caf9-b8f1-422b-8f8c-a2936a395e0e"
  },
  "status": "UP"
}

Sample Response in case of success

Any 200 status code response is appropriate.

Sample Code

@RequestMapping(value = "/uninstall", method = RequestMethod.POST)
public void uninstallApp(@RequestBody AppUninstallCallDTO appUninstallDto,
        @RequestHeader(value = "Authorization") String authorizationHeader) {

    if (appUninstallDto == null) {
        return;
    }

    appInstallService.deleteEntity(appUninstallDto.getUuid());
}

private AppInstall convertToEntity(AppInstallCallDTO appInstallDto) {

    AppInstall appInstall = modelMapper.map(appInstallDto, AppInstall.class);
    appInstall.setUuid(appInstallDto.getApplicationInstall().getUuid());
    return appInstall;
}
}					

Learn more

Endpoint reference