SaveAppShieldPolicy

POST SaveAppShieldPolicy

URL: /api/AppShield/SaveAppShieldPolicy

Description Save or update Yurbi AppShield object. This call will create a new Policy or for existing Policy update the Policy record. This call returns an updated JSON structure with any errors populated in errorCode or ErrorMessage properties. For new Policy you can get the JSON structure from the NewPoloicy API (see /api/AppShield/NewPolicy).

Method

POST

Data Params

{
groups: [list of group ids],
isDeepSave= bool,
policy: [policy object],
sessionToken : [string],
users: [list of user ids]
}

Example

{
  "sessionToken": "GZSXIFQZZTB[QSYXBBJGPRKWS",
  "policy": {
    "Constraints": [],
    "CreatedBy": null,
    "CreatedDate": "2016-10-25T13:18:17.625658-04:00",
    "Description": "AppShield Policy Created 10/25/2016 1:18:17 PM",
    "ErrorCode": null,
    "ErrorMessage": null,
    "Groups": null,
    "ModifiedBy": null,
    "ModifiedDate": "10/25/2016 1:18:17 PM",
    "Name": "New AppShield Policy",
    "Users": null,
    "id": null,
    "isActive": false
  },
  "isDeepSave": true,
  "groups": [
    "16",
    "11"
  ],
  "users": [
    "635055077867776462",
    "635176414815914719"
  ]
}

Success Response 

Code: 200

{
  "Constraints": [],
  "CreatedBy": {
    …full contact object of CreatedBy user removed here…
  },
  "CreatedDate": "2016-10-25T13:18:30.9455587-04:00",
  "Description": "AppShield Policy Created 10/25/2016 1:18:17 PM",
  "ErrorCode": "0",
  "ErrorMessage": "",
  "Groups": [
    {
      "AllRoles": null,
      "AllUsers": null,
      "ErrorCode": 0,
      "ErrorMessage": null,
      "GroupCreated": "0001-01-01T00:00:00",
      "GroupDescription": null,
      "GroupId": "16",
      "GroupModified": "0001-01-01T00:00:00",
      "GroupName": null,
      "GroupRoles": null,
      "GroupStatus": 0,
      "Membership": null
    },
    {
      "AllRoles": null,
      "AllUsers": null,
      "ErrorCode": 0,
      "ErrorMessage": null,
      "GroupCreated": "0001-01-01T00:00:00",
      "GroupDescription": null,
      "GroupId": "11",
      "GroupModified": "0001-01-01T00:00:00",
      "GroupName": null,
      "GroupRoles": null,
      "GroupStatus": 0,
      "Membership": null
    }
  ],
  "id": "636129983109455587",
  "isActive": false,
  "ModifiedBy": {
  ..last modified by contact removed here...
  },
  "ModifiedDate": "10/25/2016 1:18:30 PM",
  "Name": "New AppShield Policy",
  "Users": [
    {
      "AllApplications": null,
      "AllGroups": null,
      "AllRoles": null,
      "ApplicationConstraints": null,
      "AuthType": null,
      "ComboName": null,
      "CreateDate": "0001-01-01T00:00:00",
      "Description": null,
      "EmailAddress": null,
      "ErrorCode": 0,
      "ErrorMessage": null,
      "FirstName": null,
      "FullName": null,
      "ID": "635055077867776462",
      "LastName": null,
      "LoginDate": "0001-01-01T00:00:00",
      "LoginName": null,
      "ModifyDate": "0001-01-01T00:00:00",
      "Pin": null,
      "Preferences": null,
      "SecurityGroups": null,
      "UserApplications": null,
      "UserState": 0,
      "isAdmin": false,
      "isAgent": false,
      "isArchitect": false,
      "isBuilder": false,
      "isFirstRun": false,
      "isSuperAdmin": false
    },
    {
      "AllApplications": null,
      "AllGroups": null,
      "AllRoles": null,
      "ApplicationConstraints": null,
      "AuthType": null,
      "ComboName": null,
      "CreateDate": "0001-01-01T00:00:00",
      "Description": null,
      "EmailAddress": null,
      "ErrorCode": 0,
      "ErrorMessage": null,
      "FirstName": null,
      "FullName": null,
      "ID": "635176414815914719",
      "LastName": null,
      "LoginDate": "0001-01-01T00:00:00",
      "LoginName": null,
      "ModifyDate": "0001-01-01T00:00:00",
      "Pin": null,
      "Preferences": null,
      "SecurityGroups": null,
      "UserApplications": null,
      "UserState": 0,
      "isAdmin": false,
      "isAgent": false,
      "isArchitect": false,
      "isBuilder": false,
      "isFirstRun": false,
      "isSuperAdmin": false
    }
  ]
}

Definition of AppShield Policy return object

NameDescription
ConstraintsObject list of constraints
CreatedByCreated By User contact object
CreateDateCreation Date
DescriptionPolicy description.
ErrorCodeError code.
ErrorMessageError message
GroupsGroups assigned to policy.
idUnique id.
isActiveActive
ModifiedByLast User to modify.
ModifiedDateLast modify date of contact record
NameName of Policy
UsersUsers assigned to policy

Sample Call

$.ajax({
  url: "/api/AppShield/SaveAppShieldPolicy",
  dataType: "json",
    data : {
  "sessionToken": "GZSXIFQZZTB[QSYXBBJGPRKWS",
  "policy": {
    "Constraints": [],
    "CreatedBy": null,
    "CreatedDate": "2016-10-25T13:18:17.625658-04:00",
    "Description": "AppShield Policy Created 10/25/2016 1:18:17 PM",
    "ErrorCode": null,
    "ErrorMessage": null,
    "Groups": null,
    "ModifiedBy": null,
    "ModifiedDate": "10/25/2016 1:18:17 PM",
    "Name": "New AppShield Policy",
    "Users": null,
    "id": null,
    "isActive": false
  },
  "isDeepSave": true,
  "groups": [
    "16",
    "11"
  ],
  "users": [
    "635055077867776462",
    "635176414815914719"
  ]
},
  type : "POST",
  success : function(r) {
    console.log(r);
  }
});

Was this article helpful?

GetReport
SearchDashboardList