The API allows an application direct access to the website's database allowing the application to select, insert, update and delete data. In order to use the API you will first need a System Administrator account with API Access enabled within the website for your application to use to authenticate.
The URL for accessing the API is the administration address plus the URL to the WCF web service. An SSL connection is required to make a submission.
The Web Services Description Language (WSDL) is also accessible from this URL.
Tables Method
The Tables method has no parameters and simply returns a list of available tables that can be used for determining what tables are available.
A request and response will resemble the following.
Request...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
>
<
Action
s:mustUnderstand
=
"1"
xmlns
=
"http://schemas.microsoft.com/ws/2005/05/addressing/none"
>http://most.software/services/Data/Tables<
/Action
>
</
s:Header
>
<
s:Body
>
<
Tables
xmlns
=
"http://most.software/services/"
/>
</
s:Body
>
</
s:Envelope
>
Response...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
/>
<
s:Body
>
<
TablesResponse
xmlns
=
"http://most.software/services/"
>
<
TablesResult
>
<
xs:schema
id
=
"Database"
xmlns:xs
=
"http://www.w3.org/2001/XMLSchema"
xmlns
=
""
xmlns:msdata
=
"urn:schemas-microsoft-com:xml-msdata"
>
<
xs:element
name
=
"Database"
msdata:IsDataSet
=
"true"
msdata:UseCurrentLocale
=
"true"
>
<
xs:complexType
>
<
xs:choice
minOccurs
=
"0"
maxOccurs
=
"unbounded"
>
<
xs:element
name
=
"Tables"
msdata:CaseSensitive
=
"False"
msdata:Locale
=
"en-NZ"
>
<
xs:complexType
>
<
xs:sequence
>
<
xs:element
name
=
"Table"
type
=
"xs:string"
minOccurs
=
"0"
/>
</
xs:sequence
>
</
xs:complexType
>
</
xs:element
>
</
xs:choice
>
</
xs:complexType
>
</
xs:element
>
</
xs:schema
>
<
diffgr:diffgram
xmlns:diffgr
=
"urn:schemas-microsoft-com:xml-diffgram-v1"
xmlns:msdata
=
"urn:schemas-microsoft-com:xml-msdata"
>
<
Database
xmlns
=
""
>
<
Tables
diffgr:id
=
"Tables1"
msdata:rowOrder
=
"0"
diffgr:hasChanges
=
"inserted"
>
<
Table
>GEO_Locations</
Table
>
</
Tables
>
<
Tables
diffgr:id
=
"Tables2"
msdata:rowOrder
=
"1"
diffgr:hasChanges
=
"inserted"
>
<
Table
>GEO_Locations_Addresses</
Table
>
</
Tables
>
<
Tables
diffgr:id
=
"Tables3"
msdata:rowOrder
=
"2"
diffgr:hasChanges
=
"inserted"
>
<
Table
>LOGS_Details</
Table
>
</
Tables
>
<
Tables
diffgr:id
=
"Tables4"
msdata:rowOrder
=
"3"
diffgr:hasChanges
=
"inserted"
>
<
Table
>LOGS_Errors</
Table
>
</
Tables
>
<
Tables
diffgr:id
=
"Tables5"
msdata:rowOrder
=
"4"
diffgr:hasChanges
=
"inserted"
>
<
Table
>QUEUE_Emails</
Table
>
</
Tables
>
<
Tables
diffgr:id
=
"Tables6"
msdata:rowOrder
=
"5"
diffgr:hasChanges
=
"inserted"
>
<
Table
>QUEUE_Emails_Distribution</
Table
>
</
Tables
>
<
Tables
diffgr:id
=
"Tables7"
msdata:rowOrder
=
"6"
diffgr:hasChanges
=
"inserted"
>
<
Table
>QUEUE_Emails_Distribution_Logs</
Table
>
</
Tabl...
Columns Method
The Columns method returns a list of available columns from the specified table that can be used in conjunction with all other methods for selecting, inserting and updating data in the database.
- Table
The name of the table to return a list of columns for, the data available is:
- Name
- Type
- Size
- Precission
- Nullable
The request and response will resemble the following.
Request...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
>
<
Action
s:mustUnderstand
=
"1"
xmlns
=
"http://schemas.microsoft.com/ws/2005/05/addressing/none"
>http://most.software/services/Data/Columns</
Action
>
</
s:Header
>
<
s:Body
>
<
Columns
xmlns
=
"http://most.software/services/"
>
<
Table
>SITE_Documents</
Table
>
</
Columns
>
</
s:Body
>
</
s:Envelope
>
Response...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
/>
<
s:Body
>
<
ColumnsResponse
xmlns
=
"http://most.software/services/"
>
<
ColumnsResult
>
<
xs:schema
id
=
"Database"
xmlns:xs
=
"http://www.w3.org/2001/XMLSchema"
xmlns
=
""
xmlns:msdata
=
"urn:schemas-microsoft-com:xml-msdata"
>
<
xs:element
name
=
"Database"
msdata:IsDataSet
=
"true"
msdata:UseCurrentLocale
=
"true"
>
<
xs:complexType
>
<
xs:choice
minOccurs
=
"0"
maxOccurs
=
"unbounded"
>
<
xs:element
name
=
"SITE_Documents_x0020_Columns"
msdata:CaseSensitive
=
"False"
msdata:Locale
=
"en-NZ"
>
<
xs:complexType
>
<
xs:sequence
>
<
xs:element
name
=
"Name"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Type"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Size"
type
=
"xs:short"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Precission"
type
=
"xs:unsignedByte"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Nullable"
type
=
"xs:boolean"
minOccurs
=
"0"
/>
</
xs:sequence
>
</
xs:complexType
>
</
xs:element
>
</
xs:choice
>
</
xs:complexType
>
</
xs:element
>
</
xs:schema
>
<
diffgr:diffgram
xmlns:diffgr
=
"urn:schemas-microsoft-com:xml-diffgram-v1"
xmlns:msdata
=
"urn:schemas-microsoft-com:xml-msdata"
>
<
Database
xmlns
=
""
>
<
SITE_Documents_x0020_Columns
diffgr:id
=
"SITE_Documents Columns1"
msdata:rowOrder
=
"0"
diffgr:hasChanges
=
"inserted"
>
<
Name
>ID</
Name
>
<
Type
>uniqueidentifier</
Type
>
<
Size
>16</
Size
>
<
Precission
>0</
Precission
>
<
Nullable
>false</
Nullable
>
</
SITE_Documents_x0020_Columns
>
<
SITE_Documents_x0020_Columns
diffgr:id
=
"SITE_Documents Columns2"
msdata:rowOrder
=
"1"
diffgr:hasChanges
=
"inserted"
>
<
Name
>Application ID</
Name
>
<
Type
>uniqueidentifier</
Type
>
<
Size
>16</
Size
>
<
Precission
>0</
Precission
>
<
Nullable
>false</
Nullable
>
</
SITE_Documents_x0020_Columns
>
<
SITE_Documents_x0020_Columns
diffgr:id
=
"SITE_Documents Columns3"
msdata:rowOrder
=
"2"
diffgr:hasChanges
=
"inserted"
>
<
Name
>CRM Profile ID</
Name
>
<
Type
>uniqueidentifier</
Type
>
<
Size
>16</
Size
>
<
Precission
>0</
Precission
>
<
Nullable
>true</
Nullable
>
</
SITE...
Select Method
The Select method allows for the retrieving of data and requires parameters to determine what to retrieve.
- Table
The name of the table to retrieve data from. The list of tables can be retrieved using the Table method above.
- Name
The name of the column to search on.
- Criteria
The criteria to use for filtering results, supported criteria are EqualTo, Contains, LessThan and GreaterThan.
- Value
The value to be searched for. When using Contains use % as a wildcard as per SQL server.
- Items
The number of items to return in the results.
- Sort
The name of the column to sort results by.
- Order
The direction to sort the results in, either Asc or Desc.
The request and response will resemble the following.
Request...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
>
<
Action
s:mustUnderstand
=
"1"
xmlns
=
"http://schemas.microsoft.com/ws/2005/05/addressing/none"
>http://most.software/services/Data/Select</
Action
>
</
s:Header
>
<
s:Body
>
<
Select
xmlns
=
"http://most.software/services/"
>
<
Table
>SITE_Documents</
Table
>
<
Name
>Name</
Name
>
<
Criteria
>EqualTo</
Criteria
>
<
Value
>default.html</
Value
>
<
Items
>10</
Items
>
<
Sort
>Modified</
Sort
>
<
Order
>Desc</
Order
>
</
Select
>
</
s:Body
>
</
s:Envelope
>
Response...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
/>
<
s:Body
>
<
SelectResponse
xmlns
=
"http://most.software/services/"
>
<
SelectResult
>
<
xs:schema
id
=
"Database"
xmlns:xs
=
"http://www.w3.org/2001/XMLSchema"
xmlns
=
""
xmlns:msdata
=
"urn:schemas-microsoft-com:xml-msdata"
>
<
xs:element
name
=
"Database"
msdata:IsDataSet
=
"true"
msdata:UseCurrentLocale
=
"true"
>
<
xs:complexType
>
<
xs:choice
minOccurs
=
"0"
maxOccurs
=
"unbounded"
>
<
xs:element
name
=
"SITE_Documents"
msdata:CaseSensitive
=
"False"
msdata:Locale
=
"en-NZ"
>
<
xs:complexType
>
<
xs:sequence
>
<
xs:element
name
=
"ID"
msdata:DataType
=
"System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Folder_x0020_ID"
msdata:DataType
=
"System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Section_x0020_ID"
msdata:DataType
=
"System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Type_x0020_ID"
msdata:DataType
=
"System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Name"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Description"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Culture"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Owner_x0020_Account_x0020_ID"
msdata:DataType
=
"System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Open_x0020_Account_x0020_ID"
msdata:DataType
=
"System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
type
=
"xs:string"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Reviewed"
type
=
"xs:dateTime"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Published"
type
=
"xs:dateTime"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Expired"
type
=
"xs:dateTime"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Deleted"
type
=
"xs:dateTime"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Comments"
type
=
"xs:boolean"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Comments_x0020_Mediated"
type
=
"xs:boolean"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Comments_x0020_Auto_x0020_Approve"
type
=
"xs:boolean"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Comments_x0020_View"
type
=
"xs:boolean"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Comments_x0020_Add"
type
=
"xs:boolean"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Locked"
type
=
"xs:boolean"
minOccurs
=
"0"
/>
<
xs:element
name
=
"Copy_x0020_Protected"
type
=
"xs:boolean"
minOccurs
=
"0"
/>
</
xs:sequence
>
</
xs:complexType
>
</
xs:element
>
</
xs:choice
>
</
xs:complexType
>
</
xs:element
>
</
xs:schema
>
<
diffgr:diffgram
xmlns:diffgr
=
"urn:schemas-microsoft-com:xml-diffgram-v1"
xmlns:msdata
=
"urn:schemas-microsoft-com:xml-msdata"
>
<
Database
xmlns
=
""
>
<
SITE_Documents
diffgr:id
=
"SITE_Documents1"
msdata:rowOrder
=
"0"
diffgr:hasChanges
=
"inserted"
>
<
ID
>7e707a0e-4bf6-437d-a1ca-03a7aee61ea7</
ID
>
<
Folder_x0020_ID
>440857b2-da53-48cd-acf2-c7097285bcd1</
Folder_x0020_ID
>
<
Type_x0020_ID
>81c049de-5d52-4db0-9793-482671ae384a</
Type_x0020_ID
>
<
Name
>default.html</
Name
>
<
Description
>FAQs</
Description
>
<
Culture
>en</
Culture
>
<
Owner_x0020_Account_x0020_ID
>ffefcbe0-c6af-4dab-b536-bd8971c470eb</
Owner_x0020_Account_x0020_ID
>
<
Published
>2015-04-16T06:25:00+12:00</
Published
>
<
Comments
>false</
Comments
>
<
Comments_x0020_Mediated
>true</
Comments_x0020_Mediated
>
<
Comments_x0020_Auto_x0020_Approve
>false</
Comments_x0020_Auto_x0020_Approve
>
<
Comments_x0020_View
>true</
Comments_x0020_View
>
<
Comments_x0020_Add
>true</
Comments_x0020_Add
>
<
Locked
>false</
Locked
>
<
Copy_x0020_Protected
>false</
Copy_x0020_Protected
>
</
SITE_Documents
>
<
SITE_Documents
diffgr:id
=
"SITE_Documents2"
msdata:rowOrder
=
"1"
diffgr:hasChanges
=
"inserted"
>
<
ID
>5410b801-d559-461d-9be6-03dd563a6d16</
ID
>
<
Folder_x0020_ID
>0976e2f6-b70b-4a49-bf7f-d8bdd8cadd43</
Folder_x0020_ID
>
<
Type_x0020_ID
>81c049de-5d52-4db0-9793-482671ae384a</
Type_x0020_ID
>
<
Name
>default.html</
Name
>
<
Description
>Challenging a Will</
Description
>
<
Culture
>en</
Culture
>
<
Owner_x0020_Account_x0020_ID
>6584a2d7-49a4-4cb9-830a-936a2919a82b</
Owner_x0020_Account_x0020_ID
>
<
Published
>2003-05-22T12:04:00+12:00</
Published
>
<
Comments
>false</
Comments
>
<
Comments_x0020_Mediated
>true</
Comments_x0020_Mediated
>
<
Comments_x0020_Auto_x0020_Approve
>false</
Comments_x0020_Auto_x0020_Approve
>
<
Comments_x0020_View
>true</
Comments_x0020_View
>
<
Comments_x0020_Add
>true</
Comments_x0020_Add
>
<
Locked
>false</
Locked
>
<
Copy_x0020_Protected
>false</
Copy_x0020_Protected
>
</
SITE...
Insert Method
The Insert method allows for a new row to be created in a database table. It will only insert a single row and parameters are required to define what will be inserted and to where. The method returns the primary key ID of that row.
- Table
The name of the table to insert the row into.
- Items
A list of column name/values to insert.
The request and response will resemble the following.
Request...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
>
<
Action
s:mustUnderstand
=
"1"
xmlns
=
"http://schemas.microsoft.com/ws/2005/05/addressing/none"
>http://most.software/services/Data/Insert</
Action
>
</
s:Header
>
<
s:Body
>
<
Insert
xmlns
=
"http://most.software/services/"
>
<
Table
>SITE_Folders</
Table
>
<
Items
xmlns:d4p1
=
"http://schemas.datacontract.org/2004/07/MoST.Services"
xmlns:i
=
"http://www.w3.org/2001/XMLSchema-instance"
>
<
d4p1:Data.Column
>
<
d4p1:Name
>Path</
d4p1:Name
>
<
d4p1:Value
>/</
d4p1:Value
>
</
d4p1:Data.Column
>
<
d4p1:Data.Column
>
<
d4p1:Name
>Name</
d4p1:Name
>
<
d4p1:Value
>Test</
d4p1:Value
>
</
d4p1:Data.Column
>
</
Items
>
</
Insert
>
</
s:Body
>
</
s:Envelope
>
Response...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
/>
<
s:Body
>
<
InsertResponse
xmlns
=
"http://most.software/services/"
>
<
InsertResult
>926ae2f2-70fa-4fa9-bf01-133453fb6ae7</
InsertResult
>
</
InsertResponse
>
</
s:Body
>
</
s:Envelope
>
Update Method
The Update method allows for a single row of data to be updated and requires parameters similar to inserting a row with the addition of an ID parameter. The method returns the number of rows affected, this will either be 1 or 0.
- Table
The name of the table to update the row within.
- ID
The primary key ID (GUID) for the row.
- Items
A list of column name/values to insert.
The request and response will resemble the following.
Request...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
>
<
Action
s:mustUnderstand
=
"1"
xmlns
=
"http://schemas.microsoft.com/ws/2005/05/addressing/none"
>http://most.software/services/Data/Update</
Action
>
</
s:Header
>
<
s:Body
>
<
Update
xmlns
=
"http://most.software/services/"
>
<
Table
>SITE_Folders</
Table
>
<
ID
>926ae2f2-70fa-4fa9-bf01-133453fb6ae7</
ID
>
<
Items
xmlns:d4p1
=
"http://schemas.datacontract.org/2004/07/MoST.Services"
xmlns:i
=
"http://www.w3.org/2001/XMLSchema-instance"
>
<
d4p1:Data.Column
>
<
d4p1:Name
>Name</
d4p1:Name
>
<
d4p1:Value
>Test-2</
d4p1:Value
>
</
d4p1:Data.Column
>
</
Items
>
</
Update
>
</
s:Body
>
</
s:Envelope
>
Response...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
/>
<
s:Body
>
<
UpdateResponse
xmlns
=
"http://most.software/services/"
>
<
UpdateResult
>1</
UpdateResult
>
</
UpdateResponse
>
</
s:Body
>
</
s:Envelope
>
UpdateFile Method
The UpdateFile method allows for updating a binary object in a database column. The object can be a file or image and is represented as a Base64 encoded byte array. To insert a new file, simply use the Insert method then update the relevant binary column with the files data.
- Table
The name of the table to update the file within.
- ID
The primary key ID (GUID) for the row.
- Name
The name of the binary column to be updated.
- Value
The Base64 encoded byte array of data to update with.
Delete Method
The Delete method allows for a single row of data to be permanently deleted from the specified table. If a row is deleted by mistake it will either need to be re-inserted or restored from backup.
- Table
The name of the table to delete the row from.
- ID
The primary key ID (GUID) for the row being deleted.
The request and response will resemble the following.
Request...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
>
<
Action
s:mustUnderstand
=
"1"
xmlns
=
"http://schemas.microsoft.com/ws/2005/05/addressing/none"
>http://most.software/services/Data/Delete</
Action
>
</
s:Header
>
<
s:Body
>
<
Delete
xmlns
=
"http://most.software/services/"
>
<
Table
>SITE_Folders</
Table
>
<
ID
>926ae2f2-70fa-4fa9-bf01-133453fb6ae7</
ID
>
</
Delete
>
</
s:Body
>
</
s:Envelope
>
Response...
<
s:Envelope
xmlns:s
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
s:Header
/>
<
s:Body
>
<
DeleteResponse
xmlns
=
"http://most.software/services/"
>
<
DeleteResult
>1</
DeleteResult
>
</
DeleteResponse
>
</
s:Body
>
</
s:Envelope
>
Your comments have been posted, thank you.
Please make sure all required fields are completed.
Please make sure all required fields are completed.
Links to external sites are not supported.
Your email address doesn't appear to be correct.
An error occured while attempting to post your comment, please try again.