Developer Center

Centres API

Last Updated: Feb 20, 2017 04:26PM CET

URL

/api/centres
/api/centres/{id}
/api/centres/{id}/custominformation/{customFieldId}

Description

Allows the retrieve of centres which are being used by an organisation. For information about custom fields and custom field sets seeSee Custom Fields API.

Methods

GET Centres

Allows retrieving centres via a paginated list, by using the centre id/key or by using the assinged branch key/id. While using the centre id/key the full details of the centre can be retreived(address, custom fields). The centre custom field values can be changed using patch or delete methods.

Parameters

fullDetails Whether to load all the nested fields for the centresas well (true or false)
branchID The id of the branch on which the centre is assigned to, filter the centre results on

Usage examples

//get up to 100 centres for the organization
GET /api/centres?limit=100&offset=0

//get the centres by branch id using pagination
GET /api/centres?branchId=2&limit=100&offset=0

//get the centre by id
GET /api/centres/MP1

//get the centre by encoded key
GET /api/centres/8a33ae49441c4fe101441c713b3a0010

//get the centre by id with full details
GET /api/centres/MP1?fulldetails=true


Samples responses:

//response containing the centers in the system, similar response when fetching centres list by branchId
[  
   {  
      "encodedKey":"8a33ae49441c4fe101441c713b38000f",
      "id":"DT1n",
      "creationDate":"2014-02-10T15:36:26+0000",
      "lastModifiedDate":"2014-02-13T10:03:36+0000",
      "name":"Down Town",
      "assignedBranchKey":"8a33ae49441c4fe101441c713aa3000d"
   },
   {  
      "encodedKey":"8a33ae49441c4fe101441c713b3a0010",
      "id":"MP1",
      "creationDate":"2014-02-10T15:36:26+0000",
      "lastModifiedDate":"2014-02-12T15:25:17+0000",
      "name":"Market Place",
      "meetingDay":"MONDAY",
      "assignedBranchKey":"8a33ae49441c4fe101441c713b36000e"
   }
]

//response a single centre fetch by id/key
{  
   "encodedKey":"8a33ae49441c4fe101441c713b3a0010",
   "id":"MP1",
   "creationDate":"2014-02-10T15:36:26+0000",
   "lastModifiedDate":"2014-02-12T15:25:17+0000",
   "name":"Market Place",
   "meetingDay":"MONDAY",
   "assignedBranchKey":"8a33ae49441c4fe101441c713b36000e"
}

//response a single centre with full details by id/key
{  
   "encodedKey":"8a33ae49441c4fe101441c713b3a0010",
   "id":"MP1",
   "creationDate":"2014-02-10T15:36:26+0000",
   "lastModifiedDate":"2014-02-17T12:45:59+0000",
   "name":"Market Place",
   "notes":"All clients and officers gather in the market to discuss loans and savings situation.",
   "meetingDay":"MONDAY",
   "assignedBranchKey":"8a33ae49441c4fe101441c713b36000e",
   "address":{  
      "encodedKey":"8a33ae49441c4fe101441c713c310012",
      "parentKey":"8a33ae49441c4fe101441c713b3a0010",
      "line1":"Hegyalja út 95.",
      "line2":"Stress address 2124",
      "city":"Debrecen",
      "region":"",
      "postcode":"4032",
      "country":"",
      "indexInList":-1
   },
   "customFieldValues":[  
      {  
         "encodedKey":"8a42711a4425d77d014425e4505d0082",
         "parentKey":"8a33ae49441c4fe101441c713b3a0010",
         "customFieldKey":"8a33ae494420ac160144254049a00bf5",
         "customField":{  
            "encodedKey":"8a33ae494420ac160144254049a00bf5",
            "id":"centre_test_Centres",
            "name":"centre test",
            "type":"CENTRE_INFO",
            "dataType":"STRING",
            "valueLength":"SHORT",
            "isDefault":false,
            "isRequired":false,
            "description":"",
            "customFieldSet":{  
               "encodedKey":"8a33ae494420ac1601442540165e0bf4",
               "name":"Centre",
               "notes":"",
               "createdDate":"2014-02-12T08:39:20+0000",
               "indexInList":0,
               "type":"CENTRE_INFO"
            },
            "indexInList":0,
            "state":"NORMAL"
         },
         "value":"sa",
         "indexInList":-1
      }
   ]
}

PATCH Centre Custom Field Values

Custom field values for a centre can be added/edited using PATCH method. The new custom field value is validated based on the cusotm field type defined in the Custom Field.

Parameters for PATCH custom fields method for centre

value New value for custom field. Required.
customFieldID The id of the custom field to be edited. Required when editing multiple.
customFieldSetGroupIndex The index of the custom field set to be edited. If it isn't provided, a new set is added.

Usage Example

// Update the custom field value to "10" based on the centre id(abc123) and on the custom field id(members)
PATCH '{ "value": "10" }' /api/centres/abc123/custominformation/members

// Update the custom field value to "2012-10-10" based on the centre key(40288a134887e7e9014887f0eb720003) and on the custom field key(8a27a878491d417601491d48203100d9)
PATCH '{ "value": "2012-10-10" }' /api/centres/40288a134887e7e9014887f0eb720003/custominformation/8a27a878491d417601491d48203100d9

// Update(add / edit) multiple grouped and / or standard fields from different groups for the centre with the id 1111. For a grouped custom field, if customFieldSetGroupIndex is present, value is updated, if is missing, a new group is created. 
PATCH '{
  "customInformation": [
    {
      "customFieldID" : "IBAN",
      "value" : "DE123456789121243546783"
    },
    {
      "customFieldID" : "BIC",
      "value" : "1234566441",
      "customFieldSetGroupIndex" : "0"
    },
    {
      "customFieldID" : "BANK_ACCOUNT_TYPE",
      "value" : "Current Account",
      "customFieldSetGroupIndex" : "1"
    }
  ]
}' /api/centres/111/custominformation/

Response

A 200 Response is returned if the centre custom field value was successfully created/updated.

GET Centre Custom Field Values

Allows retrieving a custom field value for a given centre directly by the ID/key of the centre and the ID/key of the custom field.

Usage Example

//get the custom field value of the custom field with the ID "family_members" for the centre having ID "abc123"
GET /api/centres/abc123/custominformation/family_members
//get the custom field value of the custom field with the encoded key "8a8080a254a98efe0154a99ad86f00ef" for the centre having key "8a8080a254a98efe0154a99ad8c400f6"
GET /api/centres/8a8080a254a98efe0154a99ad8c400f6/custominformation/8a8080a254a98efe0154a99ad86f00ef

Response

//response for a single custom field
[
  {
    "encodedKey": "8a8080a254a98efe0154a99ad9d301be",
    "parentKey": "8a8080a254a98efe0154a99ad8c400f6",
    "customFieldKey": "8a8080a254a98efe0154a99ad86f00ef",
    "customField": {
      "encodedKey": "8a8080a254a98efe0154a99ad86f00ef",
      "id": "Position_Clients",
      "creationDate": "2016-05-18T14:39:13+0000",
      "lastModifiedDate": "2016-05-18T14:40:19+0000",
      "name": "Position",
      "type": "CENTRE_INFO",
      "dataType": "STRING",
      "valueLength": "SHORT",
      "isDefault": false,
      "isRequired": false,
      "description": "",
      "customFieldSet": {
        "encodedKey": "8a8080a254a98efe0154a99ad84200ee",
        "name": "Custom Fields",
        "createdDate": "2016-05-13T10:12:58+0000",
        "indexInList": 0,
        "type": "CENTRE_INFO",
        "usage": "SINGLE"
      },
      "indexInList": 3,
      "state": "NORMAL",
      "customFieldSelectionOptions": [],
      "viewRights": {
        "encodedKey": "8a8080a254a98efe0154a99ad87200f0",
        "isAccessibleByAllUsers": false,
        "roles": []
      },
      "editRights": {
        "encodedKey": "8a8080a254a98efe0154a99ad87300f1",
        "isAccessibleByAllUsers": false,
        "roles": []
      },
      "unique": false,
      "values": [],
      "amounts": {}
    },
    "value": "Promotions manager",
    "indexInList": 0,
    "customFieldID": "Position_Clients",
    "customFieldSetGroupIndex": -1
  }
]
//response for a grouped custom field
[
  {
    "encodedKey": "8a8080a254c4397d0154c450f88d0034",
    "parentKey": "8a8080a254a98efe0154a99ad8c800fa",
    "customFieldKey": "8a8080a254c4397d0154c45093f4002a",
    "customField": {
      "encodedKey": "8a8080a254c4397d0154c45093f4002a",
      "id": "ccc1",
      "creationDate": "2016-05-18T14:41:36+0000",
      "lastModifiedDate": "2016-05-18T14:41:36+0000",
      "name": "cccc1",
      "type": "CENTRE_INFO",
      "dataType": "STRING",
      "valueLength": "SHORT",
      "isDefault": false,
      "isRequired": false,
      "description": "",
      "customFieldSet": {
        "encodedKey": "8a8080a254c4397d0154c450633e0029",
        "name": "groupedcfs",
        "notes": "",
        "createdDate": "2016-05-18T14:41:23+0000",
        "indexInList": 2,
        "type": "CENTRE_INFO",
        "usage": "GROUPED"
      },
      "indexInList": 14,
      "state": "NORMAL",
      "customFieldSelectionOptions": [],
      "viewRights": {
        "encodedKey": "8a8080a254c4397d0154c45093f4002b",
        "isAccessibleByAllUsers": false,
        "roles": []
      },
      "editRights": {
        "encodedKey": "8a8080a254c4397d0154c45093f4002c",
        "isAccessibleByAllUsers": false,
        "roles": []
      },
      "unique": false,
      "values": [],
      "amounts": {}
    },
    "value": "111",
    "indexInList": 0,
    "customFieldID": "ccc1",
    "customFieldSetGroupIndex": 0
  },
  {
    "encodedKey": "8a8080a254c4397d0154c4545f410037",
    "parentKey": "8a8080a254a98efe0154a99ad8c800fa",
    "customFieldKey": "8a8080a254c4397d0154c45093f4002a",
    "customField": {
      "encodedKey": "8a8080a254c4397d0154c45093f4002a",
      "id": "ccc1",
      "creationDate": "2016-05-18T14:41:36+0000",
      "lastModifiedDate": "2016-05-18T14:41:36+0000",
      "name": "cccc1",
      "type": "CENTRE_INFO",
      "dataType": "STRING",
      "valueLength": "SHORT",
      "isDefault": false,
      "isRequired": false,
      "description": "",
      "customFieldSet": {
        "encodedKey": "8a8080a254c4397d0154c450633e0029",
        "name": "groupedcfs",
        "notes": "",
        "createdDate": "2016-05-18T14:41:23+0000",
        "indexInList": 2,
        "type": "CENTRE_INFO",
        "usage": "GROUPED"
      },
      "indexInList": 14,
      "state": "NORMAL",
      "customFieldSelectionOptions": [],
      "viewRights": {
        "encodedKey": "8a8080a254c4397d0154c45093f4002b",
        "isAccessibleByAllUsers": false,
        "roles": []
      },
      "editRights": {
        "encodedKey": "8a8080a254c4397d0154c45093f4002c",
        "isAccessibleByAllUsers": false,
        "roles": []
      },
      "unique": false,
      "values": [],
      "amounts": {}
    },
    "value": "222",
    "indexInList": 2,
    "customFieldID": "ccc1",
    "customFieldSetGroupIndex": 1
  },
  {
    "encodedKey": "8a8080a254c4397d0154c4545f410039",
    "parentKey": "8a8080a254a98efe0154a99ad8c800fa",
    "customFieldKey": "8a8080a254c4397d0154c45093f4002a",
    "customField": {
      "encodedKey": "8a8080a254c4397d0154c45093f4002a",
      "id": "ccc1",
      "creationDate": "2016-05-18T14:41:36+0000",
      "lastModifiedDate": "2016-05-18T14:41:36+0000",
      "name": "cccc1",
      "type": "CENTRE_INFO",
      "dataType": "STRING",
      "valueLength": "SHORT",
      "isDefault": false,
      "isRequired": false,
      "description": "",
      "customFieldSet": {
        "encodedKey": "8a8080a254c4397d0154c450633e0029",
        "name": "groupedcfs",
        "notes": "",
        "createdDate": "2016-05-18T14:41:23+0000",
        "indexInList": 2,
        "type": "CENTRE_INFO",
        "usage": "GROUPED"
      },
      "indexInList": 14,
      "state": "NORMAL",
      "customFieldSelectionOptions": [],
      "viewRights": {
        "encodedKey": "8a8080a254c4397d0154c45093f4002b",
        "isAccessibleByAllUsers": false,
        "roles": []
      },
      "editRights": {
        "encodedKey": "8a8080a254c4397d0154c45093f4002c",
        "isAccessibleByAllUsers": false,
        "roles": []
      },
      "unique": false,
      "values": [],
      "amounts": {}
    },
    "value": "333",
    "indexInList": 4,
    "customFieldID": "ccc1",
    "customFieldSetGroupIndex": 2
  }
]

DELETE Centre Custom Field Values

Specific custom field values for a centre can be deleted based on centre id and custom field id.

Usage Example

// DELETE the custom field value based on the centre id(abc123) and on the custom field id(members)
    DELETE /api/centres/abc123/custominformation/members

    // DELETE the custom field value based on the centre key(40288a134887e7e9014887f0eb720003) and on the custom field key(8a27a878491d417601491d48203100d9)
    DELETE /api/centres/40288a134887e7e9014887f0eb720003/custominformation/8a27a878491d417601491d48203100d9

Response

A 200 Response is returned if the centre custom field value was successfully deleted.
support@mambu.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete