put https://delhivery.preprod.fxtrt.io/core/api/v2/containers/container-types//config/attributes
API to update core attributes configuration of a container type specified by containerTypeName.
The configuration includes:
- List of core attributes (names) - Data type of each core attribute.
- Validation of core attribute values, if required, for each core attribute.
Important:
- If the attribute is already defined for the container type- The validation rules will get updated for the attribute.
- If the attribute is not defined for the container type- It is added as a new core attribute for the container type.
- On successful execution of the API, all updates including change in data type will take effect immediately for the container type.
PARAMETER | DESCRIPTION | TYPE | VALIDATION |
---|---|---|---|
attributes * | |||
ㅤ↳name * | Name of the attribute to be updated. | string | Example: capacity minLength: 3 maxLength: 64 |
ㅤ↳dataType * | Field for the datatype of an attribute. | string | Example: integer Enum: [string, number, boolean, object, array] |
ㅤ↳description | Updated description of the attribute. | string | minLength: 1 maxLength: 256 |
ㅤ↳indexed | Field to specify if the attribute is to be indexed. Filter or search operation on the basis of a custom attribute will be only allowed if this field is set as TRUE. | boolean | Default: false |
defaultValue | |||
ㅤ↳validation | Specifies all the validations to be performed on an attribute, when a container of this type is created/updated. | ||
ㅤㅤㅤ↳range | Field to specify the range that the attribute value must lie. In case of "string" data type, range will be the length of string value. | number | min: The min value, inclusive. max: The max value, inclusive. |
ㅤㅤㅤ↳regex | Field to specify the regex pattern that the value of an attribute MUST match. | string | minLength: 1 maxLength: 512 |
ㅤㅤㅤ↳valueOneOf | Field to specify enum values for an attribute. list of valueOneOf should be homogeneous. | Enum | minItems: 1 |
ㅤㅤㅤ↳required | Field to specify if the value for the attribute is mandatory or not. If TRUE, the value MUST be provided. | boolean | Default value: false |
callback | Represents callback URL, which can be to notify status(success/failed) of API. | object | {url: "string", meta: {}} |
*This is required.
HTTP Status Code Summary
| Code | Description |
| ---- | ---------- |
| 202 - Accepted |
| 400 - Bad Request | The request was unacceptable, often due to missing a required parameter. |
| 401 - Unauthorized | No valid API key provided. |
| 404 - Not Found | The requested resource doesn't exist. |
| 503 - Server Error | Something went wrong. (These are rare.) |