Getting Started
Download RocketShipIt from the My Account page and extract it somewhere in your local development environment.
For macOS and Linux you can extract by doing tar -xf rocketshipit2-*.tar.gz
Next, download the license.lic
file from the My Account page and place it in the same directory.
The contents should be organized like this:
.
├── CHANGES.md
├── clients
│ ├── nodejs
│ │ ├── example.js
│ │ └── rocketshipit.js
│ ├── perl
│ │ ├── example.pl
│ │ └── RocketShipIt.pm
│ ├── php
│ │ ├── example.php
│ │ ├── README.md
│ │ └── RocketShipIt.php
│ ├── python
│ │ ├── example.py
│ │ └── rocketshipit.py
│ ├── README.md
│ └── ruby
│ ├── example.rb
│ └── rocketshipit.rb
├── license.lic
├── LICENSE.txt
├── README.txt
└── RocketShipIt
The clients
folder contains the RocketShipIt client libraries for each officially supported programming language. Next, navigate to your targeted language. For this guide we will be using php
.
cd clients/php
Open example.php
in your favorite text editor.
Then uncomment the following line and fill it in with your RocketShipIt API key which can be found in the My Account page:
$rs->apiKey = 'ADD YOUR RocketShipIt API KEY HERE';
This will instruct the RocketShipIt PHP client to connect to RocketShipIt in the cloud as this is the easiest way to get started; however, the preferred way is to self-host the RocketShipIt API.
Now run php example.php
. You should get something like:
php example.php
Array
(
[meta] => Array
(
[code] => 200
[error_message] =>
)
[data] => Array
(
[errors] => Array
(
[0] => Array
(
[code] => 1000
[description] => Authentication Failed
[type] => ERROR
)
)
[rates] =>
)
)
In this case, the Authentication Failed error is actually coming from the shipping carrier. If your RocketShipIt API key was invalid you would see an error in the meta.error_message
field. For more information about errors see: Errors
Once you fill in your carrier credentials in example.php
you should get a successful response:
Array
(
[meta] => Array
(
[code] => 200
[error_message] =>
)
[data] => Array
(
[errors] =>
[rates] => Array
(
[0] => Array
(
[desc] => UPS Next Day Air Early AM
[rate] => 118.95
[negotiated_rate] => 117.76
[currency] => USD
[service_code] => 14
[est_delivery_time] => 2018-02-26T08:30:00-00:00
[delivery_days] => 1
[package_type] =>
...
If things are not going as planned set the debug parameter to true
to see what RocketShipIt is doing behind the scenes. For more information about debug
, please see: troubleshooting
Next, we encourage you to check out the API Explorer.