Peoplevox

API Data Types


This article provides information on the data types used by the various API methods.


Common Types

Data Type

Description

Boolean

Booleans can represent one of two values: true or false.

int

Integers represent whole numbers that can be either positive or negative (e.g. 23191, -39013). They do not hold numbers with a decimal or fraction.

decimal

Decimals provide an additional precision beyond that of an integer, to express decimal numbers. (e.g. 3.14, 3.00001).

string

Strings represent any collection of characters that cannot be expressed by the types above. It is possible for numerical value to be expressed as a string value. Examples include “Hello”, “SO1234”, or even “21”.

Date and time

Dates and times are expressed by a standard template of characters, in which the different parts of the template represent different parts of the date & time.

The API expects all dates and times to be sent in UTC format. Similarly, any dates and times returned by the API will be represented in UTC unless specified otherwise.

DateTime fields are represented by the following character sequence:

“YYYY-MM-DD<space>HH:MM”

where

  • YYYY = Julian Year (e.g. 2011)

  • MM = Month (e.g. 06 refers to June)

  • DD = Day (e.g. 01 to 31)

  • <space> = a character #160, space

  • HH = Hour (00 to 23)

  • MM = Minutes (00 to 59)

Please be aware that time zone offsets are not supported - for example a value of 12:00+05:00 will simply be interpreted as 12:00.


Search Values

In scenarios where a caller is requesting data from PVX (either on an immediate API response, or via a subscription), that caller can apply a filter expression to limit the scope of the data returned. It is advisable to apply filters on the request rather than requesting large volumes of data and filtering on the response, as PVX will be able to use the filter to optimise the speed of the request.

Filters are defined as predicates to be evaluated for each member of a specified collection. For example, to filter a list of sales orders, the caller would provide a predicate that expresses the conditions that must be met in order for a sales order to be included in the response. The operators available on the predicate depend upon the data type of the field being examined.

String comparisons

String comparison is not case sensitive and requires the parameter to be enclosed in either double quote marks (for GetData filters) or single quote marks (for GetReportData filters). The list of available operators and examples below use double quotes; callers should replace these with single quotes for a GetReportData call:

Operator

Description

.Equals(“”)

Equals the enclosed string value, similar to SQL (={text})

.StartsWith(“”)

Starts with the enclosed string value, similar to SQL (LIKE ‘{text}%’)

.EndsWith(“”)

Ends with the enclosed string value, similar to SQL (LIKE ‘%{text}’)

.Contains(“”)

Contains the enclosed string value, similar to SQL (LIKE ‘%{text}%’)

= or == “”

Equals the enclosed string value, similar to SQL (={text})

!= “”

Not equal to the enclosed string value, similar to SQL (!={text})


Examples

For example, to search for string values in a field called name:

Name.Contains(“abc”)

would return prabcfg, abcpr, tAbcy

!Name.Contains(“abc”)

would not return prabcfg, abcpr, tAbcy

Name.StartsWith(“abc”)

would return abcpr, abcrana, Abct

Name.EndsWith(“abc”)

would return prabc, ranaabc, urAbc

Name.EndsWith(“abc”)

would return only abc, Abc, ABC

Name = “abc”

would return only abc, Abc, ABC

Name == “abc”

would return only abc, Abc, ABC

Name = Description

would return items which have the same name and description.

Numeric comparisons

The following operators can be used to compare integer, decimals and date values. Integers can be compared to other integers and decimals. DateTimes can only be compared to other DateTimes:

Operator

Description

>

Greater than

<

Less than

>=

Greater than or equal

<=

Less than or equal

==

Equal

!=

Not equal


Examples

For example to search for an item by reorder point in the GetData Method, a caller would pass filter values using the operators as follows:

ReorderPoint > 0

This returns all item types with a reorder point greater than zero.

ReorderPoint < 1000

This returns all item types with a reorder point less than 1000.

ReorderPoint >= 1000

This returns all item types with a reorder point greater than 1000.

ReorderPoint <= 100

This returns all item types with a reorder point less than or equal to 100.

ReorderPoint == 1234

This returns all item types with a reorder point equal to 1234

ReorderPoint != 1234

This returns all item types that do not have an reorder point equal to 1234

Date and time comparison

Numerical operators (<,>,<=,>=,==,!= ) are also applicable to DateTime fields. Callers may describe a DateTime value using the DateTime function:

DateTime(YYYY,MM,DD,HH,MM,SS)

Where YYYY = year, MM = month, DD =Day, HH = hour, MM = minute, SS = second

Example

RequestedDeliveryDate < DateTime(2011,10,26,12,00,00)

Search for records with RequestedDeliveryDate less than the 26th October 2011, 12:00am

Combination of Expressions

Callers may combine multiple expressions together using the Boolean operators OR and AND. Callers may use parentheses to explicitly group filter criteria.

Examples

ReorderPoint >= 1000 AND Name.EndsWith(“abc”)

This will return a list of records with a reorder point greater than or equal to 1000, where the name of the record also ends with the sequence “abc”.

Name.EndsWith(“abc”) AND (ReorderPoint > OnHand OR (ReorderPoint == 0 AND OnHand < 100))

This expression only returns items with na\mes ending with “abc”. Of those, the filter will return only items for which the OnHand quantity is less than the reorder point, or both reorder point is 0 AND the OnHand less than 100.

IntegrationResponse

All API responses inherit from a common type, the IntegrationResponse. All responses will share this common schema, but the behaviour of each individual method will influence how the data is populated on that response.

Attribute

Description

Values expected

ResponseId

Response code to indicate success or failure

0 - successful, -1 failed

Detail

The requested data (if querying PVX), or a more detailed success indicator if instructing PVX to do something

String

TotalCount

The number of records affected or returned by a call

integer

Statuses

A detailed list of statuses providing more granular success indicators for operations in which multiple records are updated at once

A collection of IntegrationStatusResponses

ImportingQueueId

Deprecated - no longer used

NULL

SalesOrdersToDespatchIds

Deprecated - no longer used

NULL

GetRequest

The GetRequest type is used on the GetData API method to specify the data that the caller wishes to obtain.

Attribute

Description

Values expected

TemplateName

Refer to Templates

String

SearchClause

A filter expression, refer to Search Values

String

PageNo

Page number (default is 1 and starting from 1)

int

ItemsPerPage

Number of items to retrieve per page (Max 100, anything more than 100 is reset to 100)

int

GetReportRequest

The GetReportRequest type is used on the GetReportData API method to specify the data that the caller wishes to obtain.

Attribute

Description

Values expected

TemplateName

The name of the report that the caller wishes to run, as displayed in the reporting module of the web application

String

PageNo

Page number (default is 1 and starting from 1)

int

ItemsPerPage

Number of items to retrieve per page

int

OrderBy

The fields by which to sort the data on the response. Use [square brackets] to reference the column as it is expressed in the web app reporting module. Callers may specify the sort direction by adding ‘desc’ or ‘asc’ after the column name and a space.

String

Columns

The list of columns on the report to return on the response. Use [square brackets] to reference the column as it is expressed in the web app reporting module. Leaving blank will result in all columns being returned.

String

SearchClause

A filter expression, refer to Search Values. Use [square brackets] to reference the column as it is expressed in the web app reporting module.

String

SaveRequest

The SaveRequest type is used on the SaveData API method.

Attribute

Description

Values expected

TemplateName

Refer to Templates

String

CSVData

A string value that represents the data to be saved, in CSV format. See below for an example

String

Actions

Action code

int


Actions

Value

Description

0

No Action

1

Do not allocate (only available for “Sales order items” template)

2

Delete (not available for “Sites” template)


Example SaveRequest The following example represents a SOAP request to the SaveData method, utilising the SaveRequest type to create a new item type. Note that this example assumes that the target PVX instance has an “Item types” template configured with the default mappings.

POST /clientid/Resources/IntegrationServicev4.asmx HTTP/1.1  
Content-Type: application/soap+xml;charset=UTF-8;action="http://www.peoplevox.net/SaveData"
Host: peoplevox.net 


For completeness, this is an example of the response to that call:

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8 


Back to Top