# iForm Service

## Prepare the users

- System administrator need create a Service users administrator.
  Options > Additional User > Create additional user > Assign Change password privilege.
- Service users administrator can set Tablet users password:
  Options > Tablet users > Select user... > Reset password.

## Service URL

https://eu903287-ger.eu.delhaize.com/iform/iform_srv.php

## Service commands

- ### login Send:

  Var | Format | Type
  --- | --- | ---
  FUNCTION | login | required
  USERID | string | required
  PASSWD | string | required

  Sending TOKEN will have the same effect.

- ### query_docs

  Send:

  Var | Format | Type
  --- | --- | ---
  FUNCTION | query_docs | required
  TOKEN | string | required
  DATEFROM | YYYY-MM-DD or YYYY.MM.DD or YYYY/MM/DD | required
  DATETO | YYYY-MM-DD or ... | optional if ommited, value is DATEFROM
  AFM | string | optional trader vat number
  DOCNR | string | optional document number
  DOCSER | string | optional document series
  SIGNED | 0/1/2 | optional not singed only (default), signed only, all
  PageIndex | 1,2,3... | optional default=1
  PageSize | 15,16,17... | optional default=100, minimum allowed=15

- ### get_document

  Send:

  Var | Format | Type
  --- | --- | ---
  FUNCTION | get_document | required
  TOKEN | string | required
  DOCUMENT_ID | string | required

- ### add_signature

  Send:

  Var | Format | Type
  --- | --- | ---
  FUNCTION | add_signature | required
  TOKEN | string | required
  DOCUMENT_ID | string | required
  SIGNATURE | file | required

- ### remove_signature

  Send:

  Var | Format | Type
  --- | --- | ---
  FUNCTION | remove_signature | required
  TOKEN | string | required
  DOCUMENT_ID | string | required

## Service return JSON object with the following properties

Var | Value
--- | ---
bret | result: true or false
message | Error description or other help message
data | Array of values
document | base64 encoded content of document.
token | String (authentication token)