Box Developer Documentation
Latest version

Create shield information barrier segment restriction

post
https://api.box.com/2.0
/shield_information_barrier_segment_restrictions

Creates a shield information barrier segment restriction object.

Request

bearer [ACCESS_TOKEN]
application/json

Request Body

stringin bodyrequired
"shield_information_barrier_segment_restriction"

The type of the shield barrier segment restriction for this member.

Value is always shield_information_barrier_segment_restriction

objectin body

The type and id of the restricted shield information barrier segment.

stringin bodyrequired
"1910967"

The ID reference of the restricted shield information barrier segment.

stringin bodyrequired
"shield_information_barrier_segment"

The type of the restricted shield information barrier segment.

Value is always shield_information_barrier_segment

A base representation of a shield information barrier object

The type and id of the requested shield information barrier segment.

"1910967"

The ID reference of the requesting shield information barrier segment.

"shield_information_barrier_segment"

The type of the shield barrier segment for this member.

Value is always shield_information_barrier_segment

Response

Returns the newly created Shield Information Barrier Segment Restriction object.

application/jsonClient error

Returns a not_found error if the shield information barrier or segment was not found.

application/jsonClient error

An unexpected client error.

post
Create shield information barrier segment restriction
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

TypeScript Gen
await client.shieldInformationBarrierSegmentRestrictions.createShieldInformationBarrierSegmentRestriction(
  {
    restrictedSegment: {
      id: segmentToRestrictId,
      type: 'shield_information_barrier_segment' as CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField,
    } satisfies CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField,
    shieldInformationBarrierSegment: {
      id: segmentId,
      type: 'shield_information_barrier_segment' as CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentTypeField,
    } satisfies CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentField,
    type: 'shield_information_barrier_segment_restriction' as CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField,
  } satisfies CreateShieldInformationBarrierSegmentRestrictionRequestBodyInput,
);
Python Gen
client.shield_information_barrier_segment_restrictions.create_shield_information_barrier_segment_restriction(
    CreateShieldInformationBarrierSegmentRestrictionShieldInformationBarrierSegment(
        id=segment_id,
        type=CreateShieldInformationBarrierSegmentRestrictionShieldInformationBarrierSegmentTypeField.SHIELD_INFORMATION_BARRIER_SEGMENT.value,
    ),
    CreateShieldInformationBarrierSegmentRestrictionRestrictedSegment(
        id=segment_to_restrict_id,
        type=CreateShieldInformationBarrierSegmentRestrictionRestrictedSegmentTypeField.SHIELD_INFORMATION_BARRIER_SEGMENT.value,
    ),
    type=CreateShieldInformationBarrierSegmentRestrictionType.SHIELD_INFORMATION_BARRIER_SEGMENT_RESTRICTION.value,
)
.NET Gen
await client.ShieldInformationBarrierSegmentRestrictions.CreateShieldInformationBarrierSegmentRestrictionAsync(requestBody: new CreateShieldInformationBarrierSegmentRestrictionRequestBody(restrictedSegment: new CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField() { Id = segmentToRestrictId, Type = CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField.ShieldInformationBarrierSegment }, shieldInformationBarrierSegment: new CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentField() { Id = segmentId, Type = CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentTypeField.ShieldInformationBarrierSegment }, type: CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField.ShieldInformationBarrierSegmentRestriction));
Node
const barrierSegmentRestriction = await client.shieldInformationBarrierSegmentRestrictions.create({
	type: 'shield_information_barrier_segment_restriction',
	shield_information_barrier_segment: {
		type: 'shield_information_barrier_segment',
		id: '1910967'
	},
	restricted_segment: {
		type: 'shield_information_barrier_segment',
		id: '1910968'
	}
});
console.log(`Shield information barrier segment restriction with id ${barrierSegmentRestriction.id} was created`);

Response Example

{
  "id": "11446498",
  "type": "shield_information_barrier_segment_restriction",
  "created_at": "2020-06-26T18:44:45.869Z",
  "created_by": {
    "id": "11446498",
    "type": "user"
  },
  "restricted_segment": {
    "id": "1910967",
    "type": "shield_information_barrier_segment"
  },
  "shield_information_barrier": {
    "id": "11446498",
    "type": "shield_information_barrier"
  },
  "shield_information_barrier_segment": {
    "id": "1910967",
    "type": "shield_information_barrier_segment"
  },
  "updated_at": "2020-07-26T18:44:45.869Z",
  "updated_by": {
    "id": "11446498",
    "type": "user"
  }
}