Categories

Operations with specification attributes

Operations with Specification Attributes - GET, INSERT, UPDATE, DELETE

How to get all specification attributes
GET 5

Request Type: GET

Enter the request URL: http://StoreURL/odata/specificationattribute

Auth type: Bearer Token - paste the token generated in the previous steps

Get all specification attribute

How to get specification attribute by id
GET /odata/specificationattribute('id')

Request Type: GET

Enter the request URL: http://StoreURL/odata/specificationattribute('id')

Auth type: Bearer Token - paste the token generated in the previous steps

Get specification attribute by id

How to delete specification attribute
DELETE /odata/specificationattribute('id')

Request Type: DELETE

Enter the request URL: http://StoreURL/odata/specificationattribute('id')

Auth type: Bearer Token - paste the token generated in the previous steps

Please note that in DELETE operations, you will get only "Status: 200 OK" information if the item was successfully deleted.

How to add new specification attribute
POST /odata/specificationattribute

Request Type: POST

Enter the request URL: http://StoreURL/odata/specificationattribute

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page. 

 {
    "Name": "Enter the name",
    "DisplayOrder": 1,
    "Id": "",
    "SpecificationAttributeOptions": [
    {
        "Name": "Enter the name of option",
        "DisplayOrder": 1,
        "ColorSquaresRgb": null,
        "Id": ""
    },
    {
        "Name": "Enter the name of option",
        "DisplayOrder": 2,
        "ColorSquaresRgb": null,
        "Id": ""
    }
    ]

How to update specification attribute
POST /odata/specificationattribute

Request Type: POST

Enter the request URL: http://StoreURL/odata/specificationattribute

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page. You can use the previous body request. Please note that you need to have all fields in your request.

{
    "Name": "Enter the name",
    "DisplayOrder": 1,
    "Id": "",
    "SpecificationAttributeOptions": [
    {
        "Name": "Enter the name of option",
        "DisplayOrder": 1,
        "ColorSquaresRgb": null,
        "Id": ""
    },
    {
        "Name": "Enter the name of option",
        "DisplayOrder": 2,
        "ColorSquaresRgb": null,
        "Id": ""
    }
    ]
}

How to partially update specification attribute
PATCH /odata/specificationattribute('id')

Request Type: PATCH

Enter the request URL: http://StoreURL/odata/specificationattribute('id')

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page. Please note that you don't need to have all fields in your request.

How to update whole specification attribute
PUT /odata/specificationattribute('id')

Request Type: PUT

Enter the request URL: http://StoreURL/odata/specificationattribute('id')

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page. Please note that you have to provide all fields in your request, also the "id" field.

How to add new specification attribute to product
POST /odata/product('id')/CreateProductSpecification

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('id')/CreateProductSpecification

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page. Please note that AttributeType is required field, here you have to enter the name of attribute type, i.e CustomText or Option. In the Specification Attribute and Specification Attribute Option Id you have to enter the existing IDs. 

{
    "SpecificationAttributeId":"Enter the id of specification attribute",
    "SpecificationAttributeOptionId":"Enter the id of specification attribute option",
    "CustomValue":"Enter the custom value",
    "AllowFiltering":"True/False",
    "ShowOnProductPage":"True/False",
    "DisplayOrder":"Enter the display order",
    "AttributeType":"Select Attribute Type",
    "Id":"Leave it empty"
}

How to update specification attribute assigned to product
POST /odata/product('id')/UpdateProductSpecification

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('id')/UpdateProductSpecification

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page.

{
    "SpecificationAttributeId":"Enter the id of specification attribute",
    "SpecificationAttributeOptionId":"Enter the id of specification attribute option",
    "CustomValue":"Enter the custom value",
    "AllowFiltering":"True/False",
    "ShowOnProductPage":"True/False",
    "DisplayOrder":"Enter the display order",
    "AttributeType":"Select Attribute Type",
    "Id":"Enter the specification attribute ID which you want update"
}

How to delete specification attribute from product
POST /odata/product('id')/DeleteProductSpecification

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('id')/DeleteProductSpecification

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page.

{
    "Id":"Enter the ID"
}

 

back to top