{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":463,"path":"api-reference/rest-apis/application-service-api.md","title":"Application Service API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Application Service API\n\nThe Application Service API provides endpoints that enable you to create, modify, and update application services.\n\nThis API requires that the user have the Application Service administrator \\[app\\_service\\_admin\\] role.\n\n**Important:** Starting with the Rome release, the Application Service API is no longer enhanced or supported. For details, see the [Deprecation Process \\[KB0867184\\]](https://support.servicenow.com/kb_view.do?sysparm_article=KB0867184) article in the Now Support Knowledge Base.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## Application Service - GET /now/cmdb/app\\_service/\\{sys\\_id\\}/getContent\n\nRetrieves a list of configuration items \\(CI\\) in a mapped application service and the relationships between them. Only retrieves content for services that were manually created.\n\n### URL format\n\nDefault URL: `/api/now/cmdb/app_service/{sys_id}/getContent`\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nsys\\_id\n\n</td><td>\n\nSys\\_id of the mapped application service.Data type: String\n\nTable: Mapped Application Service \\[cmdb\\_ci\\_service\\_discovered\\]\n\n</td></tr></tbody>\n</table><table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nMode\n\n</td><td>\n\nAmount of relationship data to return. Valid values:\n\n-   Full: Return CI attributes and lookup information in addition to the data returned in shallow mode.\n-   Shallow: Return parent and child relationships between CIs within a service.\n\nThe values are not case-sensitive.Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|401|Unauthorized. The user credentials are incorrect or they do not have the app\\_service\\_admin role.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table id=\"table_nyj_nl4_wlb\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncmdb\n\n</td><td>\n\nList of objects that describe the CIs associated with the specified application service.Data type: Object\n\n```\n\"cmdb\": [\n  {\n    \"items\": {Object},\n    \"relations\": [Array]\n  }\n]\n```\n\n</td></tr><tr><td>\n\ncmdb.items\n\n</td><td>\n\nCIs within the application service. If the full query parameter was passed in the request, this section includes attributes and lookup information for each CI.Data type: Array\n\n```\n\"items\": [\n  {\n    \"className\": \"String\",\n    \"values\": {Object}\n  }\n]\n```\n\n</td></tr><tr><td>\n\ncmdb.items.className\n\n</td><td>\n\nName of the class that contains the CI.Data type: String\n\n</td></tr><tr><td>\n\ncmdb.items.values\n\n</td><td>\n\nInformation to use to locate an associated CI.Data type: Object\n\n```\n\"values\": {\n  \"name\": \"String\",\n  \"sys_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\ncmdb.items.values.name\n\n</td><td>\n\nName of the CI.Data type: String\n\n</td></tr><tr><td>\n\ncmdb.items.values.sys\\_id\n\n</td><td>\n\nSys\\_id of the CI.Data type: String\n\n</td></tr><tr><td>\n\ncmdb.relations\n\n</td><td>\n\nRelationship data for associated CIs, such as hosts and their children.Data type: Array\n\n</td></tr><tr><td>\n\nservice\n\n</td><td>\n\nList of services related to the identified service.Data type: Array of Objects\n\n```\n\"service\": [\n  {\n    \"name\": \"String\",\n    \"service_relations\": [Array],\n    \"url\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nservice.name\n\n</td><td>\n\nName of the application service.Data type: String\n\n</td></tr><tr><td>\n\nservice.service\\_relations\n\n</td><td>\n\nHierarchy data for the CIs within the application service. All CIs form pairs with a parent and child CI. The top-level CI, referred to as the entry point of an application service, does not have a parent CI.Data type: Array of Objects\n\n```\n\"service_relations\": [\n  {\n    \"child\": \"String\",\n    \"parent\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nservice.service\\_relations.child\n\n</td><td>\n\nName of a child CI related to the CI.Data type: String\n\n</td></tr><tr><td>\n\nservice.service\\_relations.parent\n\n</td><td>\n\nName of a parent CI related to the CI.Data type: String\n\n</td></tr><tr><td>\n\nservice.url\n\n</td><td>\n\nRelative path to the application service. Data type: String\n\n</td></tr></tbody>\n</table>### Sample cURL request\n\n```\ncurl \"https://instance.servicenow.com/api/now/cmdb/app_service/2fce42d80a0a0bb4004af34d7e3984c8/getContent?mode=shallow\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n```\n\n```\n{\n  \"service\": {\n    \"name\": \"PeopleSoft Portals\",\n    \"url\": \"/api/now/table/cmdb_ci_service_discovered/2fce42d80a0a0bb4004af34d7e3984c8\",\n    \"service_relations\": [\n      {\n        \"parent\": \"\",\n        \"child\": \"3a2810c20a0a0bb400268337d6e942ca\"\n      },\n      {\n        \"parent\": \"3a27f1520a0a0bb400ecd6ff7afcf036\",\n        \"child\": \"3a5dd3dbc0a8ce0100655f1ec66ed42c\"\n      },\n      {\n        \"parent\": \"3a290cc60a0a0bb400000bdb386af1cf\",\n        \"child\": \"3a307c930a0a0bb400353965d0b8861f\"\n      },\n      {\n        \"parent\": \"3a172e820a0a0bb40034228e9f65f1be\",\n        \"child\": \"3a27d4370a0a0bb4006316812bf45439\"\n      },\n      {\n        \"parent\": \"\",\n        \"child\": \"3a172e820a0a0bb40034228e9f65f1be\"\n      },\n      {\n        \"parent\": \"\",\n        \"child\": \"3a27f1520a0a0bb400ecd6ff7afcf036\"\n      },\n      {\n        \"parent\": \"3a2810c20a0a0bb400268337d6e942ca\",\n        \"child\": \"3a290cc60a0a0bb400000bdb386af1cf\"\n      }\n    ]\n  },\n  \"cmdb\": {\n    \"relations\": [],\n    \"items\": [\n      {\n        \"values\": {\n          \"sys_id\": \"3a172e820a0a0bb40034228e9f65f1be\",\n          \"name\": \"PS LoadBal01\"\n        },\n        \"className\": \"cmdb_ci_win_server\"\n      },\n      {\n        \"values\": {\n          \"sys_id\": \"3a2810c20a0a0bb400268337d6e942ca\",\n          \"name\": \"PS Apache03\"\n        },\n        \"className\": \"cmdb_ci_web_server\"\n      },\n      {\n        \"values\": {\n          \"sys_id\": \"55b35562c0a8010e01cff22378e0aea9\",\n          \"name\": \"ny8500-nbxs08\"\n        },\n        \"className\": \"cmdb_ci_netgear\"\n      },\n      {\n        \"values\": {\n          \"sys_id\": \"3a27f1520a0a0bb400ecd6ff7afcf036\",\n          \"name\": \"PS Apache02\"\n        },\n        \"className\": \"cmdb_ci_web_server\"\n      },\n      {\n        \"values\": {\n          \"sys_id\": \"3a307c930a0a0bb400353965d0b8861f\",\n          \"name\": \"PS ORA01\"\n        },\n        \"className\": \"cmdb_ci_database\"\n      }\n    ]\n  }\n}\n```\n\n## Application Service - GET /now/cmdb/csdm/app\\_service/find\\_service\n\nReturns basic information about a specified application service and its associated business context.\n\n**Note:** This endpoint has been deprecated, use [SG Services – POST /sg\\_services/app\\_service/find](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/sg_services-api.md) instead.\n\n### URL format\n\nDefault URL: `/api/now/cmdb/csdm/app_service/find_service`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nname\n\n</td><td>\n\nRequired, if **number** is not passed in. Name of the service for which to return information.Data type: String\n\nTable: Service Instance \\[cmdb\\_ci\\_service\\_auto\\]\n\n</td></tr><tr><td>\n\nnumber\n\n</td><td>\n\nRequired, if **name** is not passed in. Unique number that identifies the application service for which to return information.Data type: String\n\nTable: Service Instance \\[cmdb\\_ci\\_service\\_auto\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|401|Unauthorized. The user credentials are incorrect or they do not have the app\\_service\\_admin role.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td id=\"entry-error-appservice\">\n\nDescribes an encountered error.Data type: Object\n\n```\n\"error\": {\n  \"details\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.details\n\n</td><td id=\"entry-error-details-appservice\">\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td id=\"entry-error-message-appservice\">\n\nMessage describing the error.Data type: String\n\n</td></tr><tr><td>\n\nservices\n\n</td><td>\n\nArray of objects, each object containing details of services associated with the specified application service. Data type: Array\n\n ```\n\"services\": [\n  {\n    \"environment\": \"String\",\n    \"name\": \"String\",\n    \"number\": \"String\",\n    \"relationships\": {Object},\n    \"sys_id\": \"String\",\n    \"version\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nservices.environment\n\n</td><td>\n\nEnvironment in which the application service is deployed, such as \"Production\" or \"Test Lab 2.\" This can be any value that makes sense to the implementer.Data type: String\n\nMaximum length: 40\n\nDefault: null\n\n</td></tr><tr><td>\n\nservices.name\n\n</td><td>\n\nRequired. Name of the application service. Must be a unique name from all other application services. Data type: String\n\nMaximum length: 255\n\n</td></tr><tr><td>\n\nservices.number\n\n</td><td>\n\nUnique number that identifies the application service. This value is initially generated by the endpoint.Data type: String\n\n</td></tr><tr><td>\n\nservices.relationships\n\n</td><td>\n\nService types associated with the application service. Data type: Object\n\n ```\n\"relationships\": {\n  \"business_app\": [Array],\n  \"business_service_offering\": [Array],\n  \"technical_service_offering\": [Array]\n}\n```\n\n</td></tr><tr><td>\n\nservices.relationships.business\\_app\n\n</td><td>\n\nList of sys\\_ids of the business applications related to the application service.Data type: Array\n\n</td></tr><tr><td>\n\nservices.relationships.technical\\_service\\_offering\n\n</td><td>\n\nList of sys\\_ids of the technology management offerings \\(formerly technical service offerings\\) related to the application service.Data type: Array\n\n</td></tr><tr><td>\n\nservices.relationships.business\\_service\\_offering\n\n</td><td>\n\nList of sys\\_ids of the business service offerings related to the application service.Data type: Array\n\n</td></tr><tr><td>\n\nservices.sys\\_id\n\n</td><td>\n\nSys\\_id of the application service.Data type: String\n\n</td></tr><tr><td>\n\nservices.version\n\n</td><td>\n\nApplication service version number. Data type: String\n\nMaximum length: 40\n\nFormat: User definable\n\nDefault: null\n\n</td></tr></tbody>\n</table>### Sample cURL request\n\n```\ncurl -X GET \\\n  https://instance.servicenow.com/api/now/cmdb/csdm/app_service/find_service?name=Email_East&number=SNSVC0001018 \\\n  -H 'Accept: application/json' \\\n  -u 'username':'password'\n\n```\n\n```\n{\n\"result\": {\n  \"services\": [\n    {\n      \"name\": \"Email_East\",\n      \"number\": \"SNSVC0001018\",\n      \"sys_id\": \"f809cb60db94101037740f95ca96190f\",\n      \"environment\": \"Production\",\n      \"version\": \"1.1.1\",\n      \"relationships\": {\n        \"business_app\": [\n          \"658c7620db54101037740f95ca9619f2\"\n        ],\n        \"technical_service_offering\": [],\n        \"business_service_offering\": [\n          \"069c7e20db54101037740f95ca9619bf\"\n        ]\n      }\n    }\n  ]\n }\n}\n```\n\n## Application Service - POST /now/cmdb/app\\_service/create\n\nCreates an application service or update an existing application service.\n\n### URL format\n\nDefault URL: `/api/now/cmdb/app_service/create`\n\n### Supported request parameters\n\n|Parameter|Description|\n|---------|-----------|\n|None| |\n\n### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n\n### Request body\n\nThe API accepts these JSON elements in the request body. In addition, you can add any field from the Mapped Application Service \\[cmdb\\_ci\\_service\\_discovered\\] table to pass data to the application service record. For example, to add content to the Comments field, add `\"comments\": \"Passing data to the Comments field\"` to the JSON request.\n\n|Element|Description|\n|-------|-----------|\n|name|Name of the application service you wish to create or update.|\n|service\\_relations|Information about CIs and the hierarchy they form. All CIs form pairs with a parent CI and a child CI. The top-level CI, referred to as the entry point of an application service, does not have a parent CI.|\n|parent|Sys\\_ id of the CI whose outgoing connection joins this CI with the CI at the lower level in the map hierarchy.|\n|child|Sys\\_ id of the CI whose incoming connection joins this CI with the CI located of the higher level in the map hierarchy.|\n\n### Response body\n\nThe API returns these JSON elements in the response body.\n\n<table id=\"table_mc1_pr1_tx\"><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nURL\n\n</td><td>\n\nURL of the standard table REST API for showing the sys\\_id of an application service record. This element appears only if the endpoint is successful.\n\n Data type: String\n\n</td></tr><tr><td>\n\ngetContentUrl\n\n</td><td>\n\nREST API path for getting the application service content. This element appears only if the endpoint is successful.\n\n Data type: String\n\n</td></tr><tr><td>\n\ninfo\n\n</td><td>\n\nNumber of CIs added to the application service. This element appears only if the endpoint is successful.\n\n Data type: String\n\n</td></tr><tr><td>\n\nerror\n\n</td><td>\n\nError message details.This element appears only if the endpoint fails.\n\n Data type: Object\n\n</td></tr><tr><td>\n\nmessage\n\n</td><td>\n\nError message describing the nature of the failure.This element appears only if the endpoint fails.\n\n Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStates \"failure\" if the REST API fails.This element appears only if the endpoint fails.\n\n Data type: String\n\n</td></tr></tbody>\n</table>### Sample cURL request\n\n```\ncurl \"http://<instance.servicenow.com>/api/now/cmdb/app_service/create\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n\\\"name\\\": \\\"myTestAppService\\\",\n\\\"comments\\\": \\\"Passing data to the Comments field\\\",\n\\\"service_relations\\\": [\n{ \\\"parent\\\": \\\"\\\",\n\\\"child\\\": \\\"3a70f789c0a8ce010091b0ea635b982a\\\"\n},{ \\\"parent\\\": \\\"3a70f789c0a8ce010091b0ea635b982a\\\",\n\\\"child\\\": \\\"b4fd7c8437201000deeabfc8bcbe5dc1\\\"\n},{ \\\"parent\\\": \\\"b4fd7c8437201000deeabfc8bcbe5dc1\\\",\n\\\"child\\\": \\\"53fdbc8437201000deeabfc8bcbe5d10\\\"\n}\n]\n}\" \\\n--user 'admin':'admin'\n```\n\n```\n{\n  \"result\": {\n    \"url\": \"/api/now/table/cmdb_ci_service_discovered/b1cff89fc9e19300964fcbb1ac3059a5\",\n    \"getContentUrl\": \"/api/now/cmdb/app_service/b1cff89fc9e19300964fcbb1ac3059a5/getContent\",\n    \"info\": \"3 CIs added to service\"\n  }\n}\n```\n\n## Application Service - POST /now/cmdb/csdm/app\\_service/register\\_service\n\nCreates an application service record stub in the Service Instance \\[cmdb\\_ci\\_service\\_auto\\] table and populates it with the passed in information.\n\nBefore storing the record, it validates the passed parameters and the uniqueness of the application service name. It also creates upstream relationships which provide business context to the service by associating the specified business applications, business service offerings, and technology management offerings \\(formerly technical service offerings\\) to the service application. It does not create downstream relationships to infrastructure. To define downstream relationships you must call the Application Service - PUT /now/cmdb/csdm/app\\_service/\\{service\\_sys\\_id\\}/populate\\_service endpoint.\n\n**Note:** This endpoint has been deprecated, use [SG Services – POST /sg\\_services/app\\_service/register](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/sg_services-api.md) instead.\n\n### URL format\n\nDefault URL: `/api/now/cmdb/csdm/app_service/register_service`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nbasic\\_details\n\n</td><td>\n\nRequired. Details of the service associated with the specified application service. Data type: Object\n\n```\n\"basic_details\": {\n  \"environment\": \"String\",\n  \"name\": \"String\",\n  \"version\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nbasic\\_details.environment\n\n</td><td id=\"entry-basic_details-environment-appservice\">\n\nEnvironment in which the application service is deployed, such as \"Production\" or \"Test Lab 2.\" This can be any value that makes sense to the implementer.Data type: String\n\nMaximum length: 40\n\nDefault: null\n\n</td></tr><tr><td>\n\nbasic\\_details.name\n\n</td><td id=\"entry-basic_details-name-appservice\">\n\nRequired. Name of the application service. Must be a unique name from all other application services. Data type: String\n\nMaximum length: 255\n\n</td></tr><tr><td>\n\nbasic\\_details.version\n\n</td><td id=\"entry-basic_details-version-appservice\">\n\nApplication service version number. Data type: String\n\nMaximum length: 40\n\nFormat: User definable\n\nDefault: null\n\n</td></tr><tr><td>\n\nrelationships\n\n</td><td>\n\nUpstream \\(parent\\) service types to associate with the application service.Data type: Object\n\n```\n\"relationships\": {\n  \"business_app\": [Array],\n  \"business_service_offering\": [Array],\n  \"technical_service_offering\": [Array]\n}\n```\n\nTable: CI Relationships \\[cmdb\\_rel\\_ci\\]\n\n</td></tr><tr><td>\n\nrelationships.business\\_app\n\n</td><td id=\"entry-relationships-bus_app-appservice\">\n\nList of sys\\_ids of the business applications to relate to the application service.Data type: Array\n\n</td></tr><tr><td>\n\nrelationships.business\\_service\\_offering\n\n</td><td id=\"entry-relationships-bus_srv_off-appservice\">\n\nList of sys\\_ids of the business service offerings to relate to the application service.Data type: Array\n\n</td></tr><tr><td>\n\nrelationships.technical\\_service\\_offering\n\n</td><td id=\"entry-relationships-tech_srv_off-appservice\">\n\nList of sys\\_ids of the technical service offerings to relate to the application service.Data type: Array\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|201|Successful. The application service was successfully registered.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|401|Unauthorized. The user credentials are incorrect or they do not have the app\\_service\\_admin role.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td id=\"entry-error-appservice\">\n\nDescribes an encountered error.Data type: Object\n\n```\n\"error\": {\n  \"details\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.details\n\n</td><td id=\"entry-error-details-appservice\">\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td id=\"entry-error-message-appservice\">\n\nMessage describing the error.Data type: String\n\n</td></tr><tr><td>\n\nnumber\n\n</td><td>\n\nUnique number that identifies the application service. This number is generated by the endpoint.Data type: String\n\n</td></tr><tr><td>\n\nservice\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the registered application service.Data type: String\n\n</td></tr></tbody>\n</table>### Sample cURL request\n\n```\ncurl -X POST \\\n  https://instance.servicenow.com/api/now/cmdb/csdm/app_service/register_service \\\n  -H 'Accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -u 'username':'password'\n  -d '{\n  \"basic_details\": {\n    \"environment\": \"Test Lab 2\",\n    \"name\": \"Test Lab 2\",\n    \"version\": \"1.1.1\"\n  },\n  \"relationships\": {\n    \"business_app\":[\"f07c7620db54101037740f95ca96199a\"],\n    \"business_service_offering\":[\"069c7e20db54101037740f95ca9619bf\"]\n  }\n}'\n```\n\n```\n{\n  \"result\": {\n    \"service_sys_id\": \"80f21bbadbd410103d3a93c3e296199a\",\n    \"number\": \"SNSVC0001018\"    \n  }\n}\n```\n\n## Application Service - PUT /now/cmdb/csdm/app\\_service/\\{service\\_sys\\_id\\}/populate\\_service\n\nPopulates the specified application service with a specified set of downstream configuration items \\(CI\\).\n\nBefore calling this endpoint, you must call the [POST /now/cmdb/csdm/app\\_service/register\\_service](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/application-service-api.md) endpoint to create the application service.\n\n**Note:** This endpoint has been deprecated, use [SG Services – POST /sg\\_services/app\\_service/populate](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/sg_services-api.md) instead.\n\n### URL format\n\nDefault URL: `/api/now/cmdb/csdm/app_service/{service_sys_id}/populate_service`\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nservice\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the application service to populate with the specified CIs.Data type: String\n\nTable: Service Instance \\[cmdb\\_ci\\_service\\_auto\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\npopulation\\_method\n\n</td><td>\n\nCIs to associate with the specified application service. The elements in the **population\\_method** object depend on the type of information being populated, which is defined by the **type** parameter.Data type: Object\n\nFor **type** = cmdb\\_group\\_based\n\n```\n\"population_method\": {\n  \"group_id\": \"String\",\n  \"type\": \"String\"\n}\n```\n\nFor **type** = discovery\n\n**Note:** To use this type you must activate the Service Mapping \\(com.snc.service-mapping\\) plugin.\n\n```\n\"population_method\": {\n  \"attributes\": [Array],\n  \"entry_point_id\": \"String\",\n  \"type\": \"String\"\n}\n```\n\nFor **type** = tag\\_list\n\n**Note:** To use this type you must activate the Service Mapping \\(com.snc.service-mapping\\) plugin.\n\n```\n\"population_method\": {\n  \"tags\": [Array],\n  \"type\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\npopulation\\_method.attributes\n\n</td><td>\n\nList of attributes to associate with the CI, such as host, port, name, and URL.**Note:** You must pass all required attributes.\n\nData type: Array\n\n```\n\"attributes\": {\n  \"name\":\"String\",\n  \"value\":\"String\"\n}\n```\n\n</td></tr><tr><td>\n\npopulation\\_method.attributes.name\n\n</td><td>\n\nName of the attribute, such as host, port, name, and URL.Data type: String\n\n</td></tr><tr><td>\n\npopulation\\_method.attributes.value\n\n</td><td>\n\nAttribute value.Data type: String\n\n</td></tr><tr><td>\n\npopulation\\_method.entry\\_point\n\n</td><td>\n\nRequired if **population\\_method.type** = discovery. Entry point into the application service. For additional information on entry points, see [Entry point attributes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-operations-management/r_EntryPointsforBizSvcDef.md) and [Create entry point types for Service Mapping](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-operations-management/t_CreateEntryPoint.md).Data type: String\n\n</td></tr><tr><td>\n\npopulation\\_method.group\\_id\n\n</td><td>\n\nRequired if **population\\_method.type** = cmdb\\_group\\_based. Sys\\_id of the group to associate with the CI.Data type: String\n\nTitle: CMDB Group \\[cmdb\\_group\\]\n\n</td></tr><tr><td>\n\npopulation\\_method.tags\n\n</td><td>\n\nList of tags to associate with the CI.Data type: Array of Objects\n\n```\n[\n  \"tags\": {\n    \"tag\": \"String\",\n    \"value\": \"String\"\n  }\n]\n```\n\nTitle: Key Values \\[cmdb\\_key\\_value\\]\n\n</td></tr><tr><td>\n\npopulation\\_method.tags.tag\n\n</td><td>\n\nName of the tag.Data type: String\n\n</td></tr><tr><td>\n\npopulation\\_method.tags.value\n\n</td><td>\n\nTag value.Data type: String\n\n</td></tr><tr><td>\n\npopulation\\_method.type\n\n</td><td>\n\nRequired. Type of CI to populate.Valid values:\n\n-   cmdb\\_group\\_based\n-   discovery\n-   tag\\_list\n\nData type: String\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|401|Unauthorized. The user credentials are incorrect or they do not have the app\\_service\\_admin role.|\n|500|Internal server error. An unexpected error occurred while processing the request.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td id=\"entry-error-appservice\">\n\nDescribes an encountered error.Data type: Object\n\n```\n\"error\": {\n  \"details\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.details\n\n</td><td id=\"entry-error-details-appservice\">\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td id=\"entry-error-message-appservice\">\n\nMessage describing the error.Data type: String\n\n</td></tr></tbody>\n</table>### Sample cURL request\n\nThe following code example shows how to populate an application service when the CI type is cmdb\\_group\\_based.\n\n```\ncurl -X PUT \\\n  https://instance.servicenow.com/api/now/cmdb/csdm/app_service/f809cb60db94101037740f95ca96190f/populate_service \\\n  -H 'Accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -u 'username':'password' \\\n  -d '{\n  \"population_method\": {\n    \"type\":\"cmdb_group_based\",\n    \"group_id\": \"e809cf60db94101037640f95ca961932\"\n  }\n}'\n```\n\n```\n{\n    \"result\": {}\n}\n```\n\nThe following code example shows how to populate a discovery application service.\n\n```\ncurl -X PUT \\\n  https://instance.servicenow.com/api/now/cmdb/csdm/app_service/f809cb60db94101037740f95ca96190f/populate_service \\\n  -H 'Accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -u 'username':'password' \\\n  -d '{\n  \"population_method\": {\n    \"type\":\"discovery\",\n    \"entry_point_id\":\"cmdb_ci_endpoint_ad_forest\",\n    \"attributes\": [\n      {\n        \"name\":\"host\",\n        \"value\":\"test1.com\"\n      },\n      {\n        \"name\":\"port\",\n        \"value\":\"500\"\n      },\n      {\n        \"name\":\"protocol\",\n        \"value\":\"ssh\"\n      }\n    ]\n  }\n}'\n```\n\n```\n{\n    \"result\": {}\n}\n```\n\n## Application Service - PUT /now/cmdb/csdm/app\\_service/\\{service\\_sys\\_id\\}/service\\_details\n\nUpdates the specified application service with the passed in basic information.\n\nIt also validates the uniqueness of the application service by checking the passed in information against the Identification and Reconciliation engine \\(IRE\\) rules defined on the application service class.\n\n**Note:** This endpoint has been deprecated, use [SG Services – POST /sg\\_services/app\\_service/update](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/sg_services-api.md) instead.\n\n### URL format\n\nDefault URL: `/api/now/cmdb/csdm/app_service/{service_sys_id}/service_details`\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nservice\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the application service to updated.Data type: String\n\nTable: Service Instance \\[cmdb\\_ci\\_service\\_auto\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nbasic\\_details\n\n</td><td id=\"entry-basic_details-appservice\">\n\nDetails of the service associated with the specified application service. Data type: Object\n\n```\n\"basic_details\": {\n  \"environment\": \"String\",\n  \"name\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nbasic\\_details.environment\n\n</td><td id=\"entry-basic_details-environment-appservice\">\n\nEnvironment in which the application service is deployed, such as \"Production\" or \"Test Lab 2.\" This can be any value that makes sense to the implementer.Data type: String\n\nMaximum length: 40\n\nDefault: null\n\n</td></tr><tr><td>\n\nbasic\\_details.name\n\n</td><td id=\"entry-basic_details-name-appservice\">\n\nRequired. Name of the application service. Must be a unique name from all other application services. Data type: String\n\nMaximum length: 255\n\n</td></tr><tr><td>\n\nrelationships\n\n</td><td id=\"entry-relationships-appservice\">\n\nService types to associate with the application service. Located in the CI Relationships \\[cmdb\\_rel\\_ci\\] table.Data type: Object\n\n```\n\"relationships\": {\n  \"business_app\": [Array],\n  \"business_service_offering\": [Array],\n  \"technical_service_offering\": [Array]\n}\n```\n\n</td></tr><tr><td>\n\nrelationships.business\\_app\n\n</td><td id=\"entry-relationships-bus_app-appservice\">\n\nList of sys\\_ids of the business applications to relate to the application service.Data type: Array\n\n</td></tr><tr><td>\n\nrelationships.business\\_service\\_offering\n\n</td><td id=\"entry-relationships-bus_srv_off-appservice\">\n\nList of sys\\_ids of the business service offerings to relate to the application service.Data type: Array\n\n</td></tr><tr><td>\n\nrelationships.technical\\_service\\_offering\n\n</td><td id=\"entry-relationships-tech_srv_off-appservice\">\n\nList of sys\\_ids of the technical service offerings to relate to the application service.Data type: Array\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|401|Unauthorized. The user credentials are incorrect or they do not have the app\\_service\\_admin role.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerror\n\n</td><td id=\"entry-error-appservice\">\n\nDescribes an encountered error.Data type: Object\n\n```\n\"error\": {\n  \"details\": \"String\",\n  \"message\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nerror.details\n\n</td><td id=\"entry-error-details-appservice\">\n\nAdditional information about the error.Data type: String\n\n</td></tr><tr><td>\n\nerror.message\n\n</td><td id=\"entry-error-message-appservice\">\n\nMessage describing the error.Data type: String\n\n</td></tr></tbody>\n</table>### Sample cURL request\n\n```\ncurl -X PUT \\\n  https://instance.servicenow.com/api/now/cmdb/csdm/app_service/f809cb60db94101037740f95ca96190f/service_details \\\n  -H 'Accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -u 'username':'password' \\\n  -d '{\n  \"basic_details\": {\n    \"environment\": \"Test Lab 2\"\n  },  \"relationships\": {\n    \"business_app\" :[\"f07c7620db54101037740f95ca96199a\"]\n  }\n}'\n```\n\n```\n{\n    \"result\": {}\n}\n```\n\n"}}