Skip to content

Instantly share code, notes, and snippets.

@yang
Last active August 10, 2023 05:05
Show Gist options
  • Save yang/60563e3e56c28aee0de2db3ea966171d to your computer and use it in GitHub Desktop.
Save yang/60563e3e56c28aee0de2db3ea966171d to your computer and use it in GitHub Desktop.
curl --request PUT \
--url 'https://api.bigcommerce.com/stores/8mw570y811/v3/content/pages' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: xxxxxxxxxxxxxxxxx' \
--data '{"name":"Sandbox Page","is_visible":true,"parent_id":0,"sort_order":0,"type":"page","is_homepage":false,"is_customers_only":false,"id":0,"meta_title":"string","body":"<div>Hello World!</div>","feed":"string","link":"string","meta_keywords":"","meta_description":"string","search_keywords":"trousers,pockets,luxury","url":"/sandbox","channel_id":1}'
=== to automate this ===
for page in myhomepage ... ; do
result="$( curl "https://bigcommerce-example-05-07-2023.vercel.app/$page" | munge )"
curl --request PUT \
--url 'https://api.bigcommerce.com/stores/8mw570y811/v3/content/pages' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: xxxxxxxxxxxxxxxxx' \
--data "$result"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment