Appearance
Foundation Concepts
Some familiarity with key concepts in FOUNDATION can greatly increase your development speed and ensure your application can fully leverage the business capabilities we provide.
Foundation IDs
While many systems use an integer (e.g. 123) or GUID (e.g. 9738b8f9-58ea-412c-af5a-a07d75dc5769) to correspond to a particular record, FOUNDATION uses 10-character, alpha-numeric strings to specify and organize records. We call this a "FOUNDATION ID" throughout our documentation. These IDs are unique at the company level, so an integration should not put any unique constraints on this field alone. Instead, the combination of the FOUNDATION user's companyId and their "FOUNDATION ID" constitute a unique compound key.
Using this value as the primary ID field for FOUNDATION resources allows integrations to take advantage of automatic numbering and searchability within our software.
Next-Numbering
If we were to POST a new cost code without a "costCodeId" value, it would be automatically assigned the next number ID, "2." However, if this ID came from another ERP system with a different naming convention, an ID of "GENERAL," "00-02," or "GEN02" would all be valid values. The individual record could then be queried at the show endpoint by adding the ID to the end of the route (e.g., GET foundation/v1/costcodes/00-22) to retrieve that record.
That ID will also be searchable within FOUNDATION in the Cost Codes section.
Printable Characters
IDs and text fields in FOUNDATION must be printable. Consequently, the API validates any text it receives before integrating it with FOUNDATION data. You can head off any validation issues by sanitizing your string before they are sent through our API using the following Regex Expression to validate your text:
\[\^ -\~\]+This Regex Expression is looking for a match with any character that is below ASCII32 and above ASCII126.
The following method demonstrates the validation in C#:
public static bool IsValid(this string arg)
{
if (arg == null) throw new ArgumentNullException();
string asciiBelow32AndAbove126 = "\[\^ -\~\]+";
Regex regEx = new Regex(asciiBelow32AndAbove126);
return !regEx.IsMatch(arg);
}