Save Configuration URL endpoint

This endpoint is called when a marketer saves the configuration of the template service app in the Configuration.

After the user has finished configuring the service instance, AMS will POST to the service's Save Configuration URL endpoint with the results from the user's configuration. The purpose of this endpoint is to take the configuration that the user has set and save it within the app. When AMS POSTs to the service's Save Configuration URL endpoint, the payload includes:

  • An instanceUuid. Used to tie the configuration changes with the service instance.
  • (Optional) A payload . Can be of any form chosen by the app developer. The content sent in postMessage from configure page.

AMS calls the service's Save Configuration URL endpoint with the following request:

POST <service-base-url><service-saveconfiguration-url>
Authorization: Bearer <JWT>
{
  "instanceUuid": "6ea036bb-8cfb-46c5-a826-d001d3a0349b",
  "payload": {
    //Definedbydeveloper.WhateverissentinpostMessagefromConfigurePage.
  }
}

Apps' response to the Save Configuration URL request

This endpoint should return the configuration status and status code. In the sample code we are returning an AppConfigurationChangeStatusDTO object to AMS.

Save Configuration URL payload response to AMS

{
  "configurationStatus": "CONFIGURED",
  "payload": {},
  "httpStatusCode": "200"
}

AMS postMessage to Configuration Page

AMS would then postMessage the same response to the listener in the configuration page with the results of the Save Configuration URL. This is so the page can update itself and inform the user of the configuration result.

AMS postMessage example to configuration page

{
  "requestId": "be446dc2-8f30-4fd7-95bb-c72bacff5ebf",
  "configurationStatus": "CONFIGURED",
  "payload": {},
  "httpStatusCode": "200"
}

Learn more

Developing CX Apps Template Services