External Configuration Service ============================== The external configuration service provides endpoints to get configurations stored in SCM. .. contents:: Topics Endpoints --------- Get Mobile App Configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. http:post:: externalconfiguration/getMobileAppConfig.json Get the configuration for a given mobile application. This will include any images that need to be updated or deleted. This endpoint provides a means for an application to update its content without needing to download a new version of the application. The following authentication methods are allowed for this endpoint: * :ref:`anonymous_auth` :jsonparam String integrationId: *(required)* The integration string for a caller. :jsonparam String version: *(required)* The application version as returned by this endpoint. :jsonparam Integer merchantId: *(required)* Paytronix-assigned merchant ID to perform the operation in. :jsonparam String appId: *(required)* The unique application identifier as used in the Google Play Store, or Apple App Store .. http:response:: noUpdates :jsonparam String result: *(required)* ``noUpdates`` - Indicates that the content of the app is up to date and no updates are needed. :jsonparam String version: *(required)* The version that the application should store. In the case of noUpdates, the version should be the same as the submitted version. Example: .. code:: javascript { "result":"noUpdates", "version":"20171006154115" } .. http:response:: withUpdates :jsonparam String result: *(required)* ``withUpdates`` - Indicates that the content of the app needs to be updated. :jsonparam List[String] deleteImages: *(required)* A list of image names that the application should delete. :jsonparam Map[String] downloadImages: *(required)* A mapping of image names that need to be updated to urls where the individual images can be found. :jsonparam String version: *(required)* The new version that the application should store. Example: .. code:: javascript { "result":"withUpdates", "deleteImages":["home5@2x","home5"], "downloadImages":{ "home5@hdpi":"https://d21hbu9udbu63k.cloudfront.net/mobile/fetch-image/30/y5mjgC9v2raWoMkQ_1jJgZhMEinFx9Zl4fb7105Slp/com.paytronix.jplicks/20171006154115/home5%40hdpi", "FlexTab@2x":"https://d21hbu9udbu63k.cloudfront.net/mobile/fetch-image/30/y5mjgC9v2raWoMkQ_1jJgZhMEinFx9Zl4fb7105Slp/com.paytronix.jplicks/20171006154115/FlexTab%402x" }, "version":"20171006154115" } .. http:response:: failure :jsonparam String result: *(required)* ``failure`` :jsonparam String errorCode: *(required)* The error code of the failure. :jsonparam String errorMessage: *(required)* The human readable error message of the failure. Error Codes ----------- The following are the possible codes and messages that can be returned by the External Configuration Service. There are other system-level errors which may be returned which are not documented here. The caller of the endpoint can use the returned message to display to the end user or, if different wording is desired, can provide their own mapping of code to message. +------------------------------------------------------+---------------------------------------------------------------------------+ | Code | Message | +======================================================+===========================================================================+ | ``mobile_app_config.server_error`` | Unable to retrieve configuration | +------------------------------------------------------+---------------------------------------------------------------------------+ | ``mobile_app_config.unable_to_load_merchant_config`` | Unable to locate merchant config for the given merchant id | +------------------------------------------------------+---------------------------------------------------------------------------+ | ``mobile_app_config.invalid_integration`` | Integration is not valid | +------------------------------------------------------+---------------------------------------------------------------------------+ | ``mobile_app_config.invalid_app_id`` | App id is not valid | +------------------------------------------------------+---------------------------------------------------------------------------+ | ``mobile_app_config.unable_to_load_images`` | Unable to locate or compare image versions | +------------------------------------------------------+---------------------------------------------------------------------------+ | ``mobile_app_config.unable_to_locate_domain`` | Unable to locate domain configuration service or merchant content domain | +------------------------------------------------------+---------------------------------------------------------------------------+