Bulk create Site-Department relationships.

Permission Level: Read-Write

POST /users/site/relation

Operation id: SiteService_BulkCreateSiteDepartmentRelationships

Tags: SiteService

Security

  • Authorization (apiKey)
    • Bearer token

Responses

200 — A successful response.

Content type: application/json

default — An unexpected error response.

Content type: application/json

Request body

Required: Yes

application/json

Schema

PropertyTypeRequiredDescription
tenantIdstringNoPopulates propertyCharacteristicsAndValues.tenantId
siteDepartmentRelationsarrayNo
{
  "type": "object",
  "properties": {
    "tenantId": {
      "type": "string",
      "description": "Populates propertyCharacteristicsAndValues.tenantId"
    },
    "siteDepartmentRelations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "relationshipName": {
            "type": "string",
            "description": "Populates Part 1 of Property Name [It can have underscores, but no spaces for now and in CAPS will be preferred, as it is a SYSTEM_ATTRIBUTE for the system]"
          },
          "siteDepartmentRelationType": {
            "type": "string",
            "description": "Enum with all possible values for the Site-Department relation type.",
            "enum": [
              "SITE_TYPE",
              "SITE_TIER"
            ],
            "default": "SITE_TYPE"
          },
          "departments": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "sites": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}

Response models

200 — A successful response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
createdinteger (int32)No
updatedinteger (int32)No
errorsarrayNo
{
  "type": "object",
  "properties": {
    "created": {
      "type": "integer",
      "format": "int32"
    },
    "updated": {
      "type": "integer",
      "format": "int32"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}

default — An unexpected error response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
codeinteger (int32)No
messagestringNo
detailsarrayNo
{
  "type": "object",
  "properties": {
    "code": {
      "type": "integer",
      "format": "int32"
    },
    "message": {
      "type": "string"
    },
    "details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string"
          }
        }
      }
    }
  }
}