Compliance

POST /ver2/ComplianceService.svc/locations

Creates a new Location object in the Compliance Model, optionally by copying the structure from another Location to the new Location. Supported object types are Division, Facility (Program), Unit (Element), and Point of Interest. This API does not support historical custom fields (those with Track Value History enabled).

Security: User with permission to Compliance Objects.

SDK API (create): envianceSdk.compliance.createLocation (locationInfo, onsuccess, onerror)

SDK API (create async): envianceSdk.compliance.createLocationAsync (locationInfo, onsuccess, onerror)

SDK API (copy): envianceSdk.compliance.copyLocation(locationInfo, copyFrom, onsuccess, onerror)

SDK API (copy async): envianceSdk.compliance.copyLocationAsync (locationInfo, copyFrom, onsuccess, onerror)

//EXAMPLE (CREATE)

POST /ver2/ComplianceService.svc/locations HTTP 1.1
Content-Type: application/json; charset=utf-8

{
  "locationInfo": {
    "name": "Toy Manufacturing",
    "type": "Facility",
    "parentPath": "/Manufacturing Division/Toys/",
    "timeZone": { "name": "Pacific Time (US & Canada) (UTC-08:00) (With DST)" },
    "activeDate": "2012-01-01T00:00:00",
    "fieldTemplate": "Manufacturing Facility",
    "fieldValues": [
      {"name": "Aspect",
      "values": ["Air pollution control waste"]},
      {"name": "Start Date",
      "values": ["2012-09-19T20:00:00"]},
      {"name": "Type",
      "values": ["Spill", "Near Miss"]},
      {"name": "Category",
      "values": ["Cat1", "Cat1.1", "Cat1.1.1"]}
    ],
  "documents": ["/Folder A/Document.doc"]
  }
}

//EXAMPLE (COPY)
POST /ver2/ComplianceService.svc/locations HTTP 1.1
Content-Type: application/json; charset=utf-8
 
{
  "locationInfo": {
  "name": "Toy Manufacturing",
  "type": "Facility",
  "parentPath": "/Manufacturing Division/Toys/",
  "timeZone": { "name": "Pacific Time (US & Canada) (UTC-08:00) (With DST)" },
  "activeDate": "2012-01-01T00:00:00",
  "fieldTemplate": "Manufacturing Facility",
  "fieldValues": [
    {"name": "Aspect",
    "values": ["Air pollution control waste"]},
    {"name": "Start Date",
    "values": ["2012-09-19T20:00:00"]},
    {"name": "Type",
    "values": ["Spill", "Near Miss"]},
    {"name": "Category",
    "values": ["Cat1", "Cat1.1", "Cat1.1.1"]}
  ],
  "documents": ["/Folder A/Document.doc"]
  },
  "copyFrom": "/Manufacturing Division/Books"
}

envianceSdk.compliance.createLocation

[
  {
    "name": "Toy Manufacturing",
    "type": "Facility",
    "isSensitiveData": true,
    "parentPath": "/Manufacturing Division/Toys/",
    "timeZone": {
      "name": "USA Pacific"
    },
    "fieldTemplate": "Manufacturing Facility",
    "CorityCachedID": 0,
    "CorityLink": false,
    "fieldValues": [
      {
        "name": "Aspect",
        "values": [
          "Air pollution control waste"
        ]
      },
      {
        "name": "Start Date",
        "values": [
          "2012-09-19T20:00"
        ]
      },
      {
        "name": "Type",
        "values": [
          "Spill",
          "Near Miss"
        ]
      },
      {
        "name": "Category",
        "values": [
          "Cat1",
          "Cat1.1",
          "Cat1.1.1"
        ]
      }
    ],
    "namelocalized": [
      {
        "value": "DemoLoc POI (US)",
        "culture": "en-us"
      }
    ],
    "documents": [
      "/Folder A/Document.doc"
    ]
  },
  "onsuccess",
  "onerror"
]

Request

Headers

EnvApi-Systemidstring

Specify specific system to run instead of Home

EnvApi-Packageidstring

(optional) Clients application/package ID

EnvApi-Udf-DateTime-Iso-In-CustomFieldsstring

Udfs of DateTime should use Iso

EnvApi-Udf-DateTime-ReadInUserTzstring

(obsolete) Udfs of DateTime type whould be in ReadInUserTz

EnvApi-Udf-Value-Invariantstring

(optional) Udfs - Force Non-Localized (invariant) values

EnvApi-Localization-Allstring

(optional) Extend objects with User-given Localizations

x-client-request-idstring

(optional) Client ID for double submit prevention

Request body

copyFromstring

Response

not available

string guid required

Changes

No recorded changes to this operation across all 1 revision of this API.