{
  "name": "Get Assign-Unassigned Number Check",
  "integrationType": "purecloud-data-actions",
  "actionType": "custom",
  "config": {
    "request": {
      "requestUrlTemplate": "/api/v2/telephony/providers/edges/didpools/dids?type=ASSIGNED_AND_UNASSIGNED&numberMatch=${input.Number_Match}",
      "requestType": "GET",
      "headers": {},
      "requestTemplate": "${input.rawRequest}"
    },
    "response": {
      "translationMap": {
        "ownerType": "$.entities[0].ownerType",
        "number": "$.entities[0].number",
        "total": "$.total",
        "ownerName": "$.entities[0].owner.name",
        "assigned": "$.entities[0].assigned",
        "ownerId": "$.entities[0].owner.id",
        "didPoolId": "$.entities[0].didPool.id"
      },
      "translationMapDefaults": {
        "ownerType": "\"\"",
        "number": "\"\"",
        "total": "0",
        "ownerName": "\"\"",
        "assigned": "false",
        "ownerId": "\"\"",
        "didPoolId": "\"\""
      },
      "successTemplate": "{\n  \"number\": ${number},\n  \"assigned\": ${assigned},\n  \"didPoolId\": ${didPoolId},\n  \"ownerId\": ${ownerId},\n  \"ownerName\": ${ownerName},\n  \"ownerType\": ${ownerType},\n  \"total\": ${total}\n}"
    }
  },
  "contract": {
    "input": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "Number_Match": {
            "type": "string"
          }
        }
      }
    },
    "output": {
      "successSchema": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "assigned": {
            "type": "boolean"
          },
          "didPoolId": {
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "ownerName": {
            "type": "string"
          },
          "ownerType": {
            "type": "string"
          },
          "total": {
            "type": "number"
          }
        }
      }
    }
  },
  "secure": false
}