Service Copy URL endpoint

This endpoint is expected to be invoked by AMS when an application service instance is copied. This topic explains the request that AMS sends when apps are copied. For full details about the copy process, see Service Lifecycle.

Service URL

<service-base-url><service-copy-url>

These URLs are registered with AMS when creating a service.

Request Method

POST

Request Header

Authorization: Bearer <JWT>

Content-Type=application/json

JWT 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.cdestinationUrl The destination URL Set to the service URL.
o.a.p.cdestinationId The destination id Set to a random UUID.

Sample JWT Payload

Below is an example JWT payload that AMS will use to call the application service copy endpoint:

{
 "iss": "03a22eb2-537b-471c-bf2b-2055e2f71618",
 "sub": "f866f138-0e2d-fd88-aa61-e8d21c7dbfee",
 "aud": "03a22eb2-537b-471c-bf2b-2055e2f71618",
 "exp": 1507128384000,
 "iat": 1507128324000,
 "jti": "b9b9650e-ae8c-4c93-ab96-e94f6a36f671",
 "o.a.p.csourceRequest": "f866f138-0e2d-fd88-aa61-e8d21c7dbfee",
 "o.a.p.cdestinationUrl": "https://awesomeapp.com/OMC-app/rest/1.0/services/1/instance/copy",
 "o.a.p.cdestinationId": "b95d7bea-0154-47b8-81ca-ea4e35e784a9"
}

Sample Request body

{
  "originalApplicationServiceInstance": {
    "status": "CREATED",
    "locale": null,
    "applicationServiceInstall": {
      "uuid": "4c97cc83-b531-4acb-a3f1-744375977f91",
      "name": "service4c97cc83-b531-4acb-a3f1-744375977f91",
      "description": "Some description",
      "copyUrl": "/copy",
      "invokeUrl": "http://localhost:8090/invoke",
      "smallLogo": "https://smalllogourl",
      "mediumLogo": "https://mediumUrl",
      "largeLogo": "https://largeUrl",
      "maxBatchSize": 50,
      "application": {
        "baseUrl": "baseUrl 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "configureUrl": "configure url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "description": "description 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "deleted": 0,
        "installUrl": "install url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "largeLogo": "large logo 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "mediumLogo": "medium logo 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "name": "name 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "saveConfigurationUrl": "save configuration url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "smallLogo": "small logo 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "status": "UP",
        "publicationStatus": "DEVELOPMENT",
        "statusMessage": {
          "body": "body d49dde22-640e-418c-8f79-d2d5875a0883",
          "eta": 1543980471838,
          "reason": "reason d49dde22-640e-418c-8f79-d2d5875a0883"
        },
        "statusUrl": "status url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "uninstallUrl": "uninstall url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "uuid": "4baf718a-d096-4058-8c5a-eb7db4d94925",
        "providerUuid": "b71f2a35-d13b-4aa9-b045-ffc920473dd0"
      },
      "serviceType": {
        "name": "actionfbb30059-928f-4d8f-8db3-ed66dd2bcf24",
        "externalName": "actionextfbb30059-928f-4d8f-8db3-ed66dd2bcf24",
        "description": "test ServiceTypefbb30059-928f-4d8f-8db3-ed66dd2bcf24",
        "serviceTypeDefinition": null
      },
      "supportedAssetTypes": [
        
      ],
      "deleted": 0,
      "installUuid": null,
      "productName": "productd24a586c-ed98-4efd-ad05-284ce437c45f",
      "customFieldsData": {
        "configureurl": {
          "fieldDefinition": {
            "name": "/configure",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "/configure"
        },
        "deleteurl": {
          "fieldDefinition": {
            "name": "/delete",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "/delete"
        },
        "createurl": {
          "fieldDefinition": {
            "name": "/create",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "/create"
        },
        "baseurl": {
          "fieldDefinition": {
            "name": "https://somefakeappbaseurl.com",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "https://somefakeappbaseurl.com"
        },
        "invokeurl": {
          "fieldDefinition": {
            "name": "/invoke",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "/invoke"
        }
      },
      "providerName": "provider95f0ff77-150d-411a-b4da-dd473ad5c19c",
      "supportedAssetTypeUuids": [
        
      ],
      "status": "UP"
    },
    "assetId": null,
    "uuid": "157ee5c2-6019-44da-9284-436f213e7113",
    "secret": "0f7cbcab-e1c7-4fa8-8d3a-fabf234f4fba-4cf14c26-21c4-4dcc-9a2c-d54f95d92e51",
    "recordDefinition": {
      "inputParameters": [
        {
          "dataType": "Double",
          "unique": true,
          "name": "input",
          "width": 10
        }
      ],
      "outputParameters": [
        {
          "dataType": "Double",
          "unique": true,
          "name": "output",
          "width": 10
        }
      ]
    },
    "assetType": "campaign"
  },
  "newApplicationServiceInstance": {
    "status": "CREATED",
    "locale": null,
    "applicationServiceInstall": {
      "uuid": "4c97cc83-b531-4acb-a3f1-744375977f91",
      "name": "service4c97cc83-b531-4acb-a3f1-744375977f91",
      "description": "Some description",
      "copyUrl": "/copy",
      "invokeUrl": "http://localhost:8090/invoke",
      "smallLogo": "https://smalllogourl",
      "mediumLogo": "https://mediumUrl",
      "largeLogo": "https://largeUrl",
      "maxBatchSize": 50,
      "application": {
        "baseUrl": "baseUrl 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "configureUrl": "configure url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "description": "description 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "deleted": 0,
        "installUrl": "install url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "largeLogo": "large logo 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "mediumLogo": "medium logo 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "name": "name 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "saveConfigurationUrl": "save configuration url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "smallLogo": "small logo 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "status": "UP",
        "publicationStatus": "DEVELOPMENT",
        "statusMessage": {
          "body": "body d49dde22-640e-418c-8f79-d2d5875a0883",
          "eta": 1543980471838,
          "reason": "reason d49dde22-640e-418c-8f79-d2d5875a0883"
        },
        "statusUrl": "status url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "uninstallUrl": "uninstall url 622f5db1-f4f9-4948-afaa-ab868d8d7cb7",
        "uuid": "4baf718a-d096-4058-8c5a-eb7db4d94925",
        "providerUuid": "b71f2a35-d13b-4aa9-b045-ffc920473dd0"
      },
      "serviceType": {
        "name": "actionfbb30059-928f-4d8f-8db3-ed66dd2bcf24",
        "externalName": "actionextfbb30059-928f-4d8f-8db3-ed66dd2bcf24",
        "description": "test ServiceTypefbb30059-928f-4d8f-8db3-ed66dd2bcf24",
        "serviceTypeDefinition": null
      },
      "supportedAssetTypes": [
        
      ],
      "deleted": 0,
      "installUuid": null,
      "productName": "productd24a586c-ed98-4efd-ad05-284ce437c45f",
      "customFieldsData": {
        "configureurl": {
          "fieldDefinition": {
            "name": "/configure",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "/configure"
        },
        "deleteurl": {
          "fieldDefinition": {
            "name": "/delete",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "/delete"
        },
        "createurl": {
          "fieldDefinition": {
            "name": "/create",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "/create"
        },
        "baseurl": {
          "fieldDefinition": {
            "name": "https://somefakeappbaseurl.com",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "https://somefakeappbaseurl.com"
        },
        "invokeurl": {
          "fieldDefinition": {
            "name": "/invoke",
            "label": null,
            "description": "some field def",
            "fieldType": "Text",
            "required": true,
            "requireSandbox": false,
            "hasDefaultValue": false,
            "defaultValue": null,
            "tag": null,
            "metadata": {
              
            }
          },
          "value": "/invoke"
        }
      },
      "providerName": "provider95f0ff77-150d-411a-b4da-dd473ad5c19c",
      "supportedAssetTypeUuids": [
        
      ],
      "status": "UP"
    },
    "assetId": null,
    "uuid": "3a0eefe4-005e-4eb1-8f3d-1c1b5ad86fad",
    "secret": "0f7cbcab-e1c7-4fa8-8d3a-fabf234f4fba-4cf14c26-21c4-4dcc-9a2c-d54f95d92e51",
    "recordDefinition": null,
    "assetType": "campaign"
  }
}

Note that the originalApplicationServiceInstance is sent along with the newApplicationServiceInstance.

Sample response in case of success

RESPONSE NOTES

  • A 200 level status code is returned
{
  "successful": true,
  "content": {
    "inputParameters": [
      {
        "dataType": "Double",
        "unique": true,
        "name": "input",
        "width": 10
      }
    ],
    "outputParameters": [
      {
        "dataType": "Double",
        "unique": true,
        "name": "output",
        "width": 10
      }
    ]
  },
  "errorMessage": null
}

Learn more

Endpoint reference