fetch-api

Getting Started


Authentication

All API Requests must contain an Authorization Header with a valid access token provided from auth

Pagination

All endpoints that return large result sets will support pagination. The pageSize and pageNumber parameters will be used for these endpoints. For example, if you want the next batch of items the url would look like this: https://fetch.yellowdogsoftware.com/api/v2/items?pageNumber=2&pageSize=100

If the endpoint supports pagination the response header will contain the X-Pagination key. The value of this key will be json which will include the next page link (nextPageLink). If there aren’t anymore pages left the nextPageLink value will be empty.

Example

Additional Pages

{
   "pageSize":100,
   "currentPage":1,
   "currentPageElements":100,
   "nextPageLink":"https://fetch.yellowdogsoftware.com/api/v2/dimensions?pageNumber=2&pageSize=100"
}

No Additional Pages

{
   "pageSize":100,
   "currentPage":6,
   "currentPageElements":3,
   "nextPageLink":""
}


Filtering Collections

Collections can be filtered with the filter query parameter. The filter parameter supports standard comparison operations, such as <=,>=,!=,=,>,<.

When multiple parameters are specified, the conditions are ANDed together. Multiple filters in an API request will need to be separated by a comma. Not all API endpoints accept the same Filtering collections, so you’ll need to refer to the Fetch API Reference for a complete listing of filters accepted by each endpoint.

Example: https://fetch.yellowdogsoftware.com/api/v2/purchaseOrders?Filter=docNumber='12345',lastUpdated>=’2016-11-17’


Ordering Collections

Collections can be ordered in ascending asc or descending desc directions. You can see all accepted order by parameters for a given endpoint in our Fetch API Reference.

Example: https://fetch.yellowdogsoftware.com/api/v2/purchaseOrders?orderBy=docNumber asc


Field Expansion

Fields can be expanded with the expand query parameter. Multiple field expansion in an API request will need to be separated by a comma. You can see what parameters are expandable for a given endpoint in our Fetch API Reference.

Example: https://fetch.yellowdogsoftware.com/api/v2/purchaseOrders?Expand=Stores,Vendor


Best Practices for Third Party Systems

GET Items


API Request Examples

cURL

$ curl -X GET \
  https://fetch.yellowdogsoftware.com/api/v2/dimensions \
  -H 'Authorization: Bearer {access token here}' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \

C#(RestSharp)

var client = new RestClient("https://fetch.yellowdogsoftware.com/api/v2/dimensions");
var request = new RestRequest(Method.GET);
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer");
IRestResponse response = client.Execute(request);

NodeJS

var http = require("https");

var options = {
  "method": "GET",
  "hostname": [
    "fetch",
    "yellowdogsoftware",
    "com"
  ],
  "path": [
    "api",
    "v2",
    "dimensions"
  ],
  "headers": {
    "Authorization": "Bearer",
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",  
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


Testing in Postman

What is Postman

Postman is an app for easy RESTful API exploration. You can save multiple sets of credentials (as environments) so you can quickly and easily test API calls in sandbox and production.

Install Postman & Import Collection

A collection is a predefined list of API calls that will help you get up and running quicker. Click Run in Postman button below to install/open Postman and import collection
Run in Postman

Adding Environment and Variables

Create an Environment in Postman called YellowDogInventory. Add the following variables to your collection:



Click the eye icon (top right). Click Add next to Environment.
missing



Adding environment variables to new environment. Click Add when done.
missing

Making First API Call

After the collection has been imported and the environment and all variables created you are now ready to make your first API call using Postman! Look at the pictures below for an example.

Select the environment by clicking drop down (top right)
missing



Making first api call with Items. Click `Items->Get All` then Send (Top Right).
missing

API Reference