Authentication

OAuth2

The required mechanism to get a token which expires after 30 minutes. The token is required on any request locked by security.

Getting Authorisation - using client id and client secret - and confirmation from client You need: YOURSITE : the site code for your infoodle site USERS-LOGIN-OR-CLIENT-ID : the username they normally login with USERS-CLIENT-SECRET : the users client secret accessed from their account screen

Step 1: GET HTML To authorise curl -G https://YOURSITE.infoodle.com/apiv2/oauth2/authorise -d "client_id=USERS-LOGIN-OR-CLIENT-ID" -d "redirect_uri=https://YOURSITE.infoodle.com/apiv2_auth" -d "response_type=code" Step 2: POST Authorisation back curl https://YOURSITE.infoodle.com/apiv2/oauth2/authorise -d "client_id=USERS-LOGIN-OR-CLIENT-ID" -d "redirect_uri=https://YOURSITE.infoodle.com/apiv2_auth" -d "response_type=code" -d "authorized=yes" Step 3: Take the code returned in step 2 will be in the Header - on the Location value as part of the URL. Use it to POST back along with the access token curl https://YOURSITE.infoodle.com/apiv2/oauth2/token -d "grant_type=authorization_code" -d "code=CODE-FROM-LAST-CALL" -d "client_secret=USERS-CLIENT-SECRET" -d "client_id=USERS-LOGIN-OR-CLIENT-ID" -d "redirect_uri=https://YOURSITE.infoodle.com/apiv2_auth"

Token included in authorisation header with the keyword Bearer - e.g. ... Accept: application/json Authorization: Bearer 910f98f99f9ba3d29960dd660a4e55972eda4db4 ...

Flow type authorizationCode
Authorization URL /apiv2/oauth2/authorise
Token URL /apiv2/oauth2/token
Refresh URL /apiv2/oauth2/refresh
Scopes
  • read: allows reading resources
  • write: allows modifying resources

application/json

Body Required

New Account code parameters

  • name string
  • Whether this is an income (1) or expense account code (0)

    Minimum value is 0, maximum value is 1.

  • taxable integer

    Referenced when defaulting reconciliation, or identifying transactions that can be used to reclaim gift aid. Its a taxable code when its 1, non taxable when 0

    Minimum value is 0, maximum value is 1.

  • salestax integer

    Referenced when showing tax (VAT, GST). Sales tax is included when its 1, no sales tax applies when its 0

    Minimum value is 0, maximum value is 1.

  • sort_order integer

    The order this code appears in the list

    Minimum value is 0.

  • If this is a xero account code, its the ID in xero. Read only

    Maximum length is 100.

  • shows if the code is still available in xero. Blank if its not a xero account code. Read only

    Maximum length is 50. Values are OK or No longer in Xero.

  • When the code is duplicated in infoodle (for different settings), this identifies which is the primary one for reports

    Minimum value is 0, maximum value is 1.

  • If this code is only to be referenced by a specific group. This is the group id that the user must have access to.

Responses

  • 200 application/json

    Item has been saved successfully

    Hide response attribute Show response attribute object
  • 400 application/json

    One or more errors have occurred

    Hide response attributes Show response attributes object
    • error string Deprecated

      A single error text or code

    • errors object

      An array of fields and the errors for each field

      Additional properties are allowed.

      Hide errors attribute Show errors attribute object
      • errorfield array[object]

        errorfield is the name of the field that is in error

        Hide errorfield attributes Show errorfield attributes object
        • code integer

          the specific error code for this error

        • message string

          the error message for this error

  • 401 application/json

    Authentication unauthorised

    Hide response attribute Show response attribute object
  • 403 application/json

    Invalid permission

    Hide response attribute Show response attribute object
POST /accountcode
curl \
 -X POST https://YOURSITE.infoodle.com/apiv2/accountcode \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"accountcode":"200-D","name":"Donations","incomeexpense":1,"taxable":1,"salestax":1,"sort_order":1,"xero_account_id":"62f28bd8-3d47-4302-88a3-dc6ff53d8126","xero_status":"OK","primary_for_duplicates":1,"for_group_id":28}'
Request examples
{
  "accountcode": "200-D",
  "name": "Donations",
  "incomeexpense": 1,
  "taxable": 1,
  "salestax": 1,
  "sort_order": 1,
  "xero_account_id": "62f28bd8-3d47-4302-88a3-dc6ff53d8126",
  "xero_status": "OK",
  "primary_for_duplicates": 1,
  "for_group_id": 28
}
Response examples (200)
{
  "id": 4325342
}
Response examples (400)
{
  "error": "Invalid field contents",
  "errors": {
    "errorfield": [
      {
        "code": 400,
        "message": "Invalid value supplied for field"
      }
    ]
  }
}
Response examples (401)
{
  "error": "Unauthorised"
}
Response examples (403)
{
  "error": "Invalid Permission"
}






















































































































































































Retrieve the configuration of the site

GET /global/site

This returns the list of details of the site along with the setup of the app details

Responses

GET /global/site
curl \
 -X GET https://YOURSITE.infoodle.com/apiv2/global/site \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "name": "Test Organisation",
  "address": "1 High Street, Tauranga, New Zealand",
  "currency": "NZD",
  "currency_symbol": "$",
  "date_format": "j M Y",
  "timezone": "Pacific/Auckland",
  "country_code": "US",
  "household_word": "household",
  "site_secret": "string",
  "backgroundUmageUrl": "https://www.google.com/image.png",
  "app": {
    "dashboard": {
      "items": [
        {
          "showAs": "image",
          "linkToType": "webview",
          "pageTitle": "Link to our website",
          "permission": [
            "public"
          ],
          "imageUrl": "https://www.google.com/image.png"
        }
      ]
    },
    "homePageColumns": 1
  },
  "contact": {
    "enabled": 1,
    "data": {
      "organisationName": "Test Organisation",
      "contactPhoneLabel1": "Office",
      "contactPhoneNumber1": "07 578 3085",
      "contactPhoneLabel2": "Support",
      "contactPhoneNumber2": "07 123 1234",
      "contactEmailLabel1": "Sales",
      "contactEmailAddress1": "sales@infoodle.com",
      "contactEmailLabel2": "Support",
      "contactEmailAddress2": "support@infoodle.com",
      "physicalAddressLabel1": "NZ HQ",
      "physicalAddress1": "5d Owens Place, Bayfair, New Zealand",
      "physicalAddressLabel2": "UK Office",
      "physicalAddress2": "1 High Street, Berkshire, England",
      "privacyPolicyUrl": "https://www.google.com/privacy.html"
    }
  }
}




















































The list of available libraries

GET /library/list

The list of the high level library names. A library consists of catalogues.

Responses

GET /library/list
curl \
 -X GET https://YOURSITE.infoodle.com/apiv2/library/list \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
[
  {
    "name": "string",
    "library_id": 42,
    "type": "string",
    "max_reserves": 42,
    "return_by_days": 42
  }
]



















































Notes