Webservices

For connections to webservice applications we need to configure authentication. This is done in the Webservices section of the Setup Tab.

Setup > Webservices

JSON (JavaScript Object Notation)

JSON is a standard data format used to transmit data between a server and web application, and has become the de facto data format used to communicate with a lot of webservices; rapidly replacing Xml.

JSON is a human-readable text format consisting of three primary constructs: key-value pairs, objects and arrays.

Key-Value Pairs

The most fundamental element of JSON is the key-value pair or property, providing the means to associate a value with a name. The value can either be a base type such as a string, an integer, or Boolean (true/false) value, or it can be a complex type such as an object or array. The key value pair is represented by the key or property name, optionally in quote marks, following by a colon, followed by the value.

The following are examples of key-value pairs for base types:

name : “text value”

integerproperty : 5

booleanproperty : true

dateproperty : ‘2015-01-21T12:10:20.000Z’

Objects

An object is a collection of unordered key-value pairs where the is enclosed in curly braces. Objects may be nested within inner other objects.

The following examples shows an object with a nested customer object.

{

  "order_number": "1028",

  "token": "3b26b5ecd992012ac7a5e609f2d3379e",

  "customer": {

    "email": "[email protected]",

    "first_name": "Terry",

    "last_name": "Henry"

  }

  "site": "FR011",

  "shopifyid": 126627282

}

Arrays

The array provides the means to associate multiple values with a name. Values can either be base types or objects. An array is denoted by enclosing the values with square brackets, where each value is separated by a comma.

An example of an array filled with text types:

email_addresses: ["[email protected]", "[email protected]"]

An example of an array with object types:

people : [

  { "name": "John Doe", "age": 29 },

  { "name": "Anna Smith", "age": 24 },

  { "name": "Peter Jones", "age": 39 }

]