Base Functions
Base Functions are a collection of online APIs that can be called to provide specific functionality. They are not directly using your Fieldpine data and are typically publicly visible.
The primary purpose of these functions is code within Fieldpine to call an API to perform processing that is difficult to deploy to every end site and a centralised server is a better solution
Street Addresses
Split an address
Takes an address as a single string, or array of lines and extracts the various key facts
Endpoint | /wc1/basefuncs/AddressDecodeSplit | |
Inputs | "address" |
A string with each line seperated by newline characters,
Or, an array of text lines |
fromcountry |
Default country to process from. Used to select which country database should be used first. The address
can override this if it contains an explicit country
If not provided the API may use any means to try and determine this automatically. |
|
Outputs | "label" | Array of text lines that form the final address label |
- Not all countries are loaded, more can be added if needed
- Can be called using GET or POST
POST /wc1/basefuncs/AddressDecodeSplit body: { "address": "12 Queen st\nAuckland", "fromcountry": "New Zealad" } response: "data": { "label": [ "12 Queen St", "Auckland" ] }
Try it
Address:From Country
Email Subject to UTF8
Takes an email subject line encoding using RFC standards and returns a single UTF8 string
Endpoint | /wc1/basefuncs/EmailSubjectToUTF8 | |
Inputs | "subject" | Raw Subject line from EML |
Outputs | "subject_utf8" | Resulting subject in UTF8 format |
- Input subject cannot be longer than 1000 bytes
- Commonly used character sets are supported, rarely used character sets may not be decoded
- Can be called using GET or POST
GET /wc1/basefuncs/EmailSubjectToUTF8?subject==?iso-8859-4?Q?Invoice_from_K=F2kako?= response: { "subject_utf8": "Invoice from Kōkako" }
POST /wc1/basefuncs/EmailSubjectToUTF8 body: { "subject": "=?ISO-2022-JP?B?SSBhbSBhIFByb2R1Y3QgRGVzaWduZXIgIGFuZCBJJ20gaW50ZXJlc3RlZCBpbiBzZWVpbmcgeW91ciBjdXJyZW50IG9wZW5pbmdzLg==?=" } response: { "subject_utf8": "I am a Product Designer and I'm interested in seeing your current openings." }
Try it
Email Subject Line:Documents
PDF to JSON Text
Converts a PDF into JSON containing the raw text
- This function is available with extended charged options with more capabilities
- This API is rate and size limited. You are welcome to use this API, but free = no support, can be removed or changed without warning.
- We might keep copies for any documents uploaded for development purposes, although it is generally only exceptional PDF files we are interested in
- This endpoint only extracts text. The free version does not perform any OCR or extended features.
Endpoint | /wc1/emailhttp/PdfToText | |
Inputs | body | Raw PDF file data |
Outputs | "pages" | Array of pages, where each array element is an array of strings for that page |
- Input subject cannot be longer than 1000 bytes
- Commonly used character sets are supported, rarely used character sets may not be decoded.
- Can be called using GET or POST
POST /wc1/emailhttp/PdfToText
... body PDF ... response: { "pages": [ [ " Tax Invoice", " GST 12-345-678", "Bill to", "EXAMPLE CORP Date 16/10/2023", ... ],[ "Page 2", ... ] ] }
Try it
Select a PDF file