Create Attribute set in Magento 2 using Api
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
I am trying to create an attribute set and assign multiple attribute into it using rest api
in Magento2
.
Please help me in this regard.
magento2 rest-api attribute-set
add a comment |Â
up vote
2
down vote
favorite
I am trying to create an attribute set and assign multiple attribute into it using rest api
in Magento2
.
Please help me in this regard.
magento2 rest-api attribute-set
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am trying to create an attribute set and assign multiple attribute into it using rest api
in Magento2
.
Please help me in this regard.
magento2 rest-api attribute-set
I am trying to create an attribute set and assign multiple attribute into it using rest api
in Magento2
.
Please help me in this regard.
magento2 rest-api attribute-set
magento2 rest-api attribute-set
asked 4 hours ago
Magento Learner
1309
1309
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
Magento 2 already have an API point for creating an attribute set.
http://www.example.com/rest/V1/products/attribute-sets
You have to hit API point
and have to post below value
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
Here ,here
- skeletonId is the attribute set id on which your new attribute set
TESTAMIT
build. Here 4 is Magento default attribute setDefault
Id - "entity_type_id": 4 ,Here 4 products entity type id. Most of the time, when you want to build a new build that time system asking which attributes structure will you want to follow.
Example at CURL
curl -X POST
http://www.example.com/rest/V1/products/attribute-sets
-H 'authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4'
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-H 'postman-token: 33e5dccd-7776-e22b-1a24-b484473cbe86'
-d '
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
'
PHP CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://www.example.com/rest/V1/products/attribute-sets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "n "attributeSet": n "attribute_set_name": "TESTAMIT",n "sort_order": 10,n "entity_type_id": 4n ,n "skeletonId": 4n",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4",
"cache-control: no-cache",
"content-type: application/json",
"postman-token: 10353b40-630e-ab82-849b-d6a23d7a52b2"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err)
echo "cURL Error #:" . $err;
else
echo $response;
Thank you,this is what I am looking for...
â Magento Learner
15 mins ago
can you explain a bit more on skeletonId,entity_type_id
â Magento Learner
2 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Magento 2 already have an API point for creating an attribute set.
http://www.example.com/rest/V1/products/attribute-sets
You have to hit API point
and have to post below value
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
Here ,here
- skeletonId is the attribute set id on which your new attribute set
TESTAMIT
build. Here 4 is Magento default attribute setDefault
Id - "entity_type_id": 4 ,Here 4 products entity type id. Most of the time, when you want to build a new build that time system asking which attributes structure will you want to follow.
Example at CURL
curl -X POST
http://www.example.com/rest/V1/products/attribute-sets
-H 'authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4'
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-H 'postman-token: 33e5dccd-7776-e22b-1a24-b484473cbe86'
-d '
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
'
PHP CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://www.example.com/rest/V1/products/attribute-sets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "n "attributeSet": n "attribute_set_name": "TESTAMIT",n "sort_order": 10,n "entity_type_id": 4n ,n "skeletonId": 4n",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4",
"cache-control: no-cache",
"content-type: application/json",
"postman-token: 10353b40-630e-ab82-849b-d6a23d7a52b2"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err)
echo "cURL Error #:" . $err;
else
echo $response;
Thank you,this is what I am looking for...
â Magento Learner
15 mins ago
can you explain a bit more on skeletonId,entity_type_id
â Magento Learner
2 mins ago
add a comment |Â
up vote
2
down vote
accepted
Magento 2 already have an API point for creating an attribute set.
http://www.example.com/rest/V1/products/attribute-sets
You have to hit API point
and have to post below value
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
Here ,here
- skeletonId is the attribute set id on which your new attribute set
TESTAMIT
build. Here 4 is Magento default attribute setDefault
Id - "entity_type_id": 4 ,Here 4 products entity type id. Most of the time, when you want to build a new build that time system asking which attributes structure will you want to follow.
Example at CURL
curl -X POST
http://www.example.com/rest/V1/products/attribute-sets
-H 'authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4'
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-H 'postman-token: 33e5dccd-7776-e22b-1a24-b484473cbe86'
-d '
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
'
PHP CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://www.example.com/rest/V1/products/attribute-sets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "n "attributeSet": n "attribute_set_name": "TESTAMIT",n "sort_order": 10,n "entity_type_id": 4n ,n "skeletonId": 4n",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4",
"cache-control: no-cache",
"content-type: application/json",
"postman-token: 10353b40-630e-ab82-849b-d6a23d7a52b2"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err)
echo "cURL Error #:" . $err;
else
echo $response;
Thank you,this is what I am looking for...
â Magento Learner
15 mins ago
can you explain a bit more on skeletonId,entity_type_id
â Magento Learner
2 mins ago
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Magento 2 already have an API point for creating an attribute set.
http://www.example.com/rest/V1/products/attribute-sets
You have to hit API point
and have to post below value
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
Here ,here
- skeletonId is the attribute set id on which your new attribute set
TESTAMIT
build. Here 4 is Magento default attribute setDefault
Id - "entity_type_id": 4 ,Here 4 products entity type id. Most of the time, when you want to build a new build that time system asking which attributes structure will you want to follow.
Example at CURL
curl -X POST
http://www.example.com/rest/V1/products/attribute-sets
-H 'authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4'
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-H 'postman-token: 33e5dccd-7776-e22b-1a24-b484473cbe86'
-d '
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
'
PHP CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://www.example.com/rest/V1/products/attribute-sets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "n "attributeSet": n "attribute_set_name": "TESTAMIT",n "sort_order": 10,n "entity_type_id": 4n ,n "skeletonId": 4n",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4",
"cache-control: no-cache",
"content-type: application/json",
"postman-token: 10353b40-630e-ab82-849b-d6a23d7a52b2"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err)
echo "cURL Error #:" . $err;
else
echo $response;
Magento 2 already have an API point for creating an attribute set.
http://www.example.com/rest/V1/products/attribute-sets
You have to hit API point
and have to post below value
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
Here ,here
- skeletonId is the attribute set id on which your new attribute set
TESTAMIT
build. Here 4 is Magento default attribute setDefault
Id - "entity_type_id": 4 ,Here 4 products entity type id. Most of the time, when you want to build a new build that time system asking which attributes structure will you want to follow.
Example at CURL
curl -X POST
http://www.example.com/rest/V1/products/attribute-sets
-H 'authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4'
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-H 'postman-token: 33e5dccd-7776-e22b-1a24-b484473cbe86'
-d '
"attributeSet":
"attribute_set_name": "TESTAMIT",
"sort_order": 10,
"entity_type_id": 4
,
"skeletonId": 4
'
PHP CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://www.example.com/rest/V1/products/attribute-sets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "n "attributeSet": n "attribute_set_name": "TESTAMIT",n "sort_order": 10,n "entity_type_id": 4n ,n "skeletonId": 4n",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer p0jc2h1jwpha6gmje34frq9dm7x9liv4",
"cache-control: no-cache",
"content-type: application/json",
"postman-token: 10353b40-630e-ab82-849b-d6a23d7a52b2"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err)
echo "cURL Error #:" . $err;
else
echo $response;
edited 31 secs ago
answered 3 hours ago
Amit Beraâ¦
54.7k1367160
54.7k1367160
Thank you,this is what I am looking for...
â Magento Learner
15 mins ago
can you explain a bit more on skeletonId,entity_type_id
â Magento Learner
2 mins ago
add a comment |Â
Thank you,this is what I am looking for...
â Magento Learner
15 mins ago
can you explain a bit more on skeletonId,entity_type_id
â Magento Learner
2 mins ago
Thank you,this is what I am looking for...
â Magento Learner
15 mins ago
Thank you,this is what I am looking for...
â Magento Learner
15 mins ago
can you explain a bit more on skeletonId,entity_type_id
â Magento Learner
2 mins ago
can you explain a bit more on skeletonId,entity_type_id
â Magento Learner
2 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f244998%2fcreate-attribute-set-in-magento-2-using-api%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password