Skip to content

Instantly share code, notes, and snippets.

@dsposito dsposito/api_tests.sh
Last active Aug 29, 2015

Embed
What would you like to do?
Super simple API endpoints test script for Volcano: https://github.com/volcano/volcano
# Sellers
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "name=Seller X&contact[company_name]=Seller X, Inc&contact[email]=sellerx@gmail.com" dev.volcano.com/api/sellers
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "name=Seller XY" dev.volcano.com/api/sellers/1
# Seller Callbacks
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1/callbacks
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "event=product.meta.update&url=http://localhost/api/webhook" dev.volcano.com/api/sellers/1/callbacks
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1/callbacks/1
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "url=http://loalhost/api/webhook/update" dev.volcano.com/api/sellers/1/callbacks/1
curl -X DELETE -s -o /dev/null -w "%{http_code} - DELETE - %{url_effective}\n" dev.volcano.com/api/sellers/1/callbacks/1
# Seller Contacts
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1/contacts
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "company_name=Seller X&Y, Inc&email=sellerxandy@gmail.com" dev.volcano.com/api/sellers/1/contacts
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1/contacts/1
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "email=sellerxy@gmail.com" dev.volcano.com/api/sellers/1/contacts/1
curl -X DELETE -s -o /dev/null -w "%{http_code} - DELETE - %{url_effective}\n" dev.volcano.com/api/sellers/1/contacts/1
# Seller Gateways
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1/gateways
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "type=credit_card&processor=authorizenet&meta[sandbox]=1" dev.volcano.com/api/sellers/1/gateways
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1/gateways/1
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "meta[sandbox]=0" dev.volcano.com/api/sellers/1/gateways/1
curl -X DELETE -s -o /dev/null -w "%{http_code} - DELETE - %{url_effective}\n" dev.volcano.com/api/sellers/1/gateways/1
# Customers
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "contact[first_name]=Bob&contact[last_name]=Cue&contact[email]=bobbycue@gmail.com" dev.volcano.com/api/customers
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/1
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "balance=25" dev.volcano.com/api/customers/1
curl -X DELETE -s -o /dev/null -w "%{http_code} - DELETE - %{url_effective}\n" dev.volcano.com/api/customers/1
# Customer Contacts
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/4/contacts
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "first_name=Daniel&last_name=Sposito&email=dnaiel@danielsposito.com" dev.volcano.com/api/customers/4/contacts
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/4/contacts/9
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "email=dsposito@danielsposito.com" dev.volcano.com/api/customers/4/contacts/9
curl -X DELETE -s -o /dev/null -w "%{http_code} - DELETE - %{url_effective}\n" dev.volcano.com/api/customers/4/contacts/9
# Customer Orders
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/1/orders
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/1/orders/1
# Customer Payment Methods
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/4/paymentmethods
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "account[number]=6011000000000012&account[expiration_month]=07&account[expiration_year]=2019&contact[first_name]=David&contact[last_name]=Greene&contact[address]=101 Wisteria Lane&contact[city]=Edmond&contact[state]=OK&contact[zip]=73003&contact[country]=US" dev.volcano.com/api/customers/4/paymentmethods
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/4/paymentmethods/4
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "account[number]=6011000000000012&account[expiration_month]=07&account[expiration_year]=2019&contact[first_name]=David&contact[last_name]=Greene&contact[address]=1515 Warsaw Way Lane&contact[city]=Edmond&contact[state]=OK&contact[zip]=73134&contact[country]=US" dev.volcano.com/api/customers/4/paymentmethods/4
curl -X DELETE -s -o /dev/null -w "%{http_code} - DELETE - %{url_effective}\n" dev.volcano.com/api/customers/4/paymentmethods/4
# Customer Products
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/4/products
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/4/products/2
# Customer Statistics
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/statistics/activity
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/statistics/totals
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/statistics/conversion
# Customer Transactions
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/customers/4/transactions
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n\n" dev.volcano.com/api/customers/4/transactions/2
# Products
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/products
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "name=iWatch" dev.volcano.com/api/products
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/products/1
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data ="Apple Watch" dev.volcano.com/api/products/1
curl -X DELETE -s -o /dev/null -w "%{http_code} - DELETE - %{url_effective}\n" dev.volcano.com/api/products/1
# Product Metas
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/products/3/metas
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "name=Colour" dev.volcano.com/api/products/3/metas
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/products/3/metas/2
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "name=Color" dev.volcano.com/api/products/3/metas/2
# Product Meta Options
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/products/3/metas/2/options
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "value=Grey" dev.volcano.com/api/products/3/metas/2/options
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/products/3/metas/2/options/3
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "value=Gray" dev.volcano.com/api/products/3/metas/2/options/3
# Product Options
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/products/3/options
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "name=Watch Edition" dev.volcano.com/api/products/3/options
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/products/3/options/7
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "name=Watch Sport" dev.volcano.com/api/products/3/options/7
curl -X DELETE -s -o /dev/null -w "%{http_code} - DELETE - %{url_effective}\n" dev.volcano.com/api/products/3/options/7
# Product Option Fees
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/products/3/options/8/fees
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n\n" --data "name=Retail&interval=1&interval_unit=nonrecurring&interval_price=299.00" dev.volcano.com/api/products/3/options/8/fees
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n\n" dev.volcano.com/api/products/3/options/8/fees/7
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n\n" --data "interval_price=349.00" dev.volcano.com/api/products/3/options/8/fees/7
curl -X DELETE -s -o /dev/null -w "%{http_code} - DELETE - %{url_effective}\n\n" dev.volcano.com/api/products/3/options/8/fees/8
# Endpoints
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/endpoints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.