_attributeSetsImport
Documentation: _attributeSetsImport
Function
_attributeSetsImport
function is designed to import a batch of attribute set data into the Shopranos platform. It handles the necessary authentication, sends a POST request with the attribute set data to the Shopranos API, and processes the response and potential errors. The function returns a structured result indicating the outcome of the import operation.Function Signature:
Parameters:
payload
(Array of attribute sets):Array<Object>
#### Return Value:
- **Returns**:
- A JSON object containing the result of the HTTP POST request to the Shopranos platform. The object includes:
- `StatusCode`: The HTTP status code of the response from the Shopranos platform.
- `Content`: The content of the response body from the Shopranos platform, typically containing success or error messages.
- **Type**: `Object`
- **Example**:
```javascript
{
StatusCode: "200 OK",
Content: '{"success": true, "message": "Attribute sets imported successfully."}'
}
Function Workflow:
1.
2.
3.
Authorization
header with the Bearer token and x-companyid
header with the company ID from the certificate.payload
is converted to a JSON string and sent in the request body.4.
StatusCode
and Content
from the response.5.
StatusCode
set to "EXCEPTION" and the exception message as the Content
.Example Usage:
Important Considerations:
payload
parameter must be an array of attribute set objects formatted according to the Shopranos API requirements.Catalog.Api.Features.AttributeSets.AttributeSetDTO
id
string | null
Id
companyId
string | null
CompanyId
title
string | null
Title
description
string | null
Description
groups
array[object (Catalog.Api.Features.AttributeSets.AttributeSetGroupDTO) {4}] | null
Groups
title
string | null
Title
id
string | null
Id
position
integer <int32> | null
Position
items
array[object (Catalog.Api.Features.AttributeSets.AttributeSetItemDTO) {2}] | null
Items
updateDate
string <date-time> | null
UpdateDate
insertDate
string <date-time> | null
InsertDate
_attributeSetsImport
, you can automate the import of attribute set data into the Shopranos platform, ensuring that the data is sent securely and that any issues are handled and reported appropriately.