From Cyclos 3.7, some REST services are supported, using messages formatted as JSON.
They are not just a different format than the SOAP web services, but also a different approach. In Cyclos, SOAP web services require a web service client to be configured (through the Settings menu), which will allow access to an specific IP address and have a separate set of permissions. The REST services, in the other hand, don't control access by IP address, but require an specific member to be authenticated. The services will use the same permissions as that member would have in Cyclos web application (except that the payment types need to be enabled for the rest channel). Those services use a specific rest channel, which needs to be enabled for groups, and individually per member, on the external access page.
The original use case for the REST services is the mobile application, where a member logs in the application and performs operations directly on Cyclos. The REST api was chosen because it is easier for the mobile application than SOAP. However, there is no limitation of which application can use the REST services.
Content-Type: application/json
Authorization: Basic <Base64 encoding of username:password>
The REST services are available under the url <cyclos_root>/rest/. The following services are available:
Used to access general information about the server. Does not require authentication
| Service | URI | HTTP method | Input | Result |
| Get general information about the Cyclos server | general | GET | none | Object:
|
Used to access general information about the authenticated user
| Service | URI | HTTP method | Input | Result |
| Get commonly used data for a client-side application | access/initialData | GET | none | Object:
|
Allows returning and updating the authenticated member's profile, as well as searching for other members.
| Service | URI | HTTP method | Input | Result |
| Get the authenticated member's profile | members/me | GET | none | Object:
|
| Update the authenticated member's profile | members/me | POST | Object on the request body:
The field of a custom field value can be identified passing the internal name (internalName) or field id (fieldId). If the value of a custom field value is an enumerated value it is sufficient to pass the possible value id (possibleValueId), or the enumerated string value in the value parameter. |
none |
| Get an specific member's profile information, finding the member by id | members/<id> | GET | Path variable id: the desired member's numeric identifier | Object:
|
| Get an specific member's profile information, finding the member by the principal configured on the rest channel (username, custom field, e-mail, etc) | members/principal/<principal> | GET | Path variable principal: the desired member's principal | Same object as load member by id |
| Search members using custom criteria | members | GET | Query parameters:
|
Object:
|
| Gets details of an specific member and the member custom fields | members/memberData/<id> | GET | Path variable id: The desired member id | An object that contains the following information:
|
Allows getting information on member custom fields
| Service | URI | HTTP method | Input | Result |
| Get details of a custom field by id | memberFields/<id> | GET | Path variable id: numeric identifier | Object:
|
| Get details of a custom field by internal name | memberFields/name/<internalName> | GET | Path variable internalName: custom field internal name | Same object as returning a custom field by id. |
| List all member custom fields used for the currently authenticated user | memberFields/mine | GET | none | Array of the same objects as returning a custom field by id. |
| List all member custom fields used for an specific member, finding the member by the internal identifier | memberFields/byMemberId/<id> | GET | Path variable id: the desired member's id | Array of the same objects as returning a custom field by id. |
| List all member custom fields used for an specific member, finding the member by the principal configured on the rest channel (username, custom field, e-mail, etc) | memberFields/byMemberPrincipal/<principal> | GET | Path variable principal: the desired member's principal | Array of the same objects as returning a custom field by id. |
| List all member custom fields which may be used to search members | memberFields/forSearch | GET | none | Array of the same objects as returning a custom field by id. |
| List all member custom fields which may be used to search advertisements | memberFields/forAdsSearch | GET | none | Array of the same objects as returning a custom field by id. |
| List the possible values of an enumerated custom field, finding the custom field by id, optionally filtering by parent value id | memberFields/<id>/possibleValues[/<parentId>] | GET | Path variable id: the desired custom field's id Path variable parentId: optional numeric identifier of a possible value of the field's parent, to only get values belonging to that parent |
Array of objects:
|
| List the possible values of an enumerated custom field, finding the custom field by internal name, optionally filtering by parent value id | memberFields/name/<name>/possibleValues[/<parentId>] | GET | Path variable name: the desired custom field's internal name Path variable parentId: optional numeric identifier of a possible value of the field's parent, to only get values belonging to that parent |
Array of the same objects as getting the possible values of a field by id. |
Provides access to the authenticated user contact list
| Service | URI | HTTP method | Input | Result |
| Get a contact by id | contacts/<id> | GET | Path variable id: the contact numeric identifier | Object:
|
| Get all contacts | contacts | GET | none | Array of the same objects as get contact by id |
| Get a contact by member id | contacts/byMemberId/<id> | GET | Path variable id: the member numeric identifier | Same object as get contact by id |
| Get a contact by member principal (username, custom field, e-mail, etc, as configured on the rest channel) | contacts/byMemberPrincipal/<principal> | GET | Path variable principal: the member principal | Same object as get contact by id |
| Save a contact by member id | contacts/byMemberId/<id> | POST | Path variable id: the member numeric identifier Optional request body object containing the following properties:
|
Same object as get contact by id
|
| Save a contact by member principal (username, custom field, e-mail, etc, as configured on the rest channel) | contacts/byMemberPrincipal/<principal> | POST | Path variable principal: the member principal Optional request body object containing the following properties:
|
Same object as get contact by id |
| Remove a contact by id | contacts/<id> | DELETE | Path variable id: the contact numeric identifier | none |
| Remove a contact by member id | contacts/byMemberId/<id> | DELETE | Path variable id: the member numeric identifier | none |
| Remove a contact by member principal (username, custom field, e-mail, etc, as configured on the rest channel) | contacts/byMemberPrincipal/<principal> | DELETE | Path variable principal: the member principal | none |
Provides access to data about the authenticated user's accounts
| Service | URI | HTTP method | Input | Result |
| Get an account details by id | accounts/<id> | GET | Path variable id: the account numeric identifier | Object:
|
| Get all account details | accounts | GET | none | Array of the same objects as get account by id |
| Get all accounts with their status | accounts/info | GET | none | A list of objects with the following properties:
|
| Get the default account details | accounts/default | GET | none | Same object as get account by id |
| Get an account status by id | accounts/<id>/status | GET | Path variable id: the account numeric identifier | Object:
|
| Get the default account status | accounts/default/status | GET | none | Same object as get status for specific account:
|
| Gets details of an specific transfer | accounts/transferData/<id> | GET | Path variable id: The desired transfer id | An object that contains the following information:
|
| Gets details of an specific transfer | accounts/transfer/<id> | GET | Path variable id: The desired transfer id | Object:
|
| Search for account history of an specific account | accounts/<id>/history | GET | Path variable id: The desired account id Query parameters:
|
An object with the following properties:
|
| Search for account history of the default account | accounts/default/history | GET | Same query parameters as account history for an specific account | The same result object as account history for an specific account |
| Gets details of an specific scheduled payment | accounts/scheduledPayment/<id> | GET | Path variable id: The desired transfer id | Object:
|
| Search for scheduled payments on an specific account | accounts/<id>/scheduledPayments | GET | Path variable id: The desired account id Query parameters:
|
An object with the following properties:
|
| Search for scheduled payments on the default account | accounts/default/scheduledPayments | GET | Same query parameters as scheduledPayments for an specific account | The same result object as search scheduled payments for an specific account |
| List available payment filters for an specific account | accounts/<id>/paymentFilters | GET | Path variable id: The desired account id | A list of the same objects with the following properties:
|
| List available payment filters for the default account | accounts/default/paymentFilters | GET | none | A list of the same objects as list payment filters for an specific account |
Allows getting data about transfer types, which are used to perform payments
| Service | URI | HTTP method | Input | Result |
| Get a transfer type by id | transferTypes/<id> | GET | Path variable id: the transfer type numeric identifier | Object:
|
| Search transfer types | transferTypes | GET | Query parameters:
|
Array of the same objects as get transfer type by id |
Allows making payments from the authenticated user to other members or to system accounts. To make a payment, a transfer type is always required. To be used here, the transfer type must allow the rest channel. When no transferTypeId is provided, it is possible to pass a currency id, using the first transfer type available for that currency. If neither transfer type nor currency are provided, the first available transfer type is used, prioritizing the default account.
When performing payments, the following error codes can be generated:
| Service | URI | HTTP method | Input | Result |
| Performs a validation payment from the authenticated member to another member returning crucial information needed to confirm the payment. | payments/memberPayment | POST | Request body: Object with the following properties:
The field of a custom field value can be identified passing the internal name (internalName) or field id (fieldId). If the value of a custom field value is an enumerated value it is sufficient to pass the possible value id (possibleValueId), or the enumerated string value in the value parameter. |
Object with the following properties:
|
| Perform a payment from the authenticated member to another member | payments/confirmMemberPayment | POST | Request body: Object with the following properties:
The field of a custom field value can be identified passing the internal name (internalName) or field id (fieldId). If the value of a custom field value is an enumerated value it is sufficient to pass the possible value id (possibleValueId), or the enumerated string value in the value parameter. |
Object with the following properties:
|
| Performs a validation payment from the authenticated member to a system account returning crucial information needed to confirm the payment. | payments/systemPayment | POST | Request body: Object with the following properties:
The field of a custom field value can be identified passing the internal name (internalName) or field id (fieldId). If the value of a custom field value is an enumerated value it is sufficient to pass the possible value id (possibleValueId), or the enumerated string value in the value parameter. |
Object with the following properties:
|
| Performs a payment from the authenticated member to a system account | payments/confirmSystemPayment | POST | Request body: Object with the following properties:
The field of a custom field value can be identified passing the internal name (internalName) or field id (fieldId). If the value of a custom field value is an enumerated value it is sufficient to pass the possible value id (possibleValueId), or the enumerated string value in the value parameter. |
Object with the following properties:
|
| Get the necessary information to prepare a payment | payments/paymentData | GET | Same parameters as search transfer types | Object with the following properties:
|
Allows getting information on payment custom fields
| Service | URI | HTTP method | Input | Result |
| Get details of a custom field by id | paymentFields/<id> | GET | Path variable id: numeric identifier | Same object as member custom field |
| Get details of a custom field by internal name | paymentFields/name/<internalName> | GET | Path variable internalName: custom field internal name | Same object as member custom field |
| List all payment custom fields of a given transfer type | paymentFields/byTransferType/<id> | GET | Path variable id: the transfer type numeric identifier | Array of the same objects as member custom field. |
| List all payment custom fields used as search filters on an sepecific account history | paymentFields/forSearch/<id> | GET | Path variable id: the account id | Array of the same objects as member custom field. |
| List all payment custom fields used as search filters on the default account history | paymentFields/forSearch/default | GET | none | Array of the same objects as member custom field. |
| List all payment custom fields displayed on the account history results on an sepecific account | paymentFields/forList/<id> | GET | Path variable id: the account id | Array of the same objects as member custom field. |
| List all payment custom fields displayed on the account history results on the default account | paymentFields/forList/default | GET | none | Array of the same objects as member custom field. |
| List the possible values of an enumerated custom field, finding the custom field by id, optionally filtering by parent value id | paymentFields/<id>/possibleValues[/<parentId>] | GET | Path variable id: the desired custom field's id Path variable parentId: optional numeric identifier of a possible value of the field's parent, to only get values belonging to that parent |
Array of the same objects as getting a member field's possible values. |
| List the possible values of an enumerated custom field, finding the custom field by internal name, optionally filtering by parent value id | paymentFields/name/<name>/possibleValues[/<parentId>] | GET | Path variable name: the desired custom field's internal name Path variable parentId: optional numeric identifier of a possible value of the field's parent, to only get values belonging to that parent |
Array of the same objects as getting a member field's possible values. |
Allows searching and getting data about advertisements
| Service | URI | HTTP method | Input | Result |
| Get details of an advertisement by id | ads/<id> | GET | Path variable id: numeric identifier | Object with the following properties:
|
| Search for advertisements | ads | GET | Query parameters:
|
An Object containing the following properties:
|
| Search for own advertisements, optionally returning expired or scheduled ads. Also, the objects returned contains more data, which are visible to the owner only. | ads/mine | GET | Query parameters:
|
An Object containing the following properties:
|
Allows searching and getting data about advertisement custom fields
| Service | URI | HTTP method | Input | Result |
| Get details of a custom field by id | adFields/<id> | GET | Path variable id: numeric identifier | Same object as member custom field |
| Get details of a custom field by internal name | adFields/name/<internalName> | GET | Path variable internalName: custom field internal name | Same object as member custom field |
| List all advertisement custom fields | adFields | GET | none | Array of the same objects as member custom field. |
| List all ad custom fields used as search filters | adFields/forSearch | GET | Path variable id: the account id | Array of the same objects as member custom field. |
| List the possible values of an enumerated custom field, finding the custom field by id, optionally filtering by parent value id | adFields/<id>/possibleValues[/<parentId>] | GET | Path variable id: the desired custom field's id Path variable parentId: optional numeric identifier of a possible value of the field's parent, to only get values belonging to that parent |
Array of the same objects as getting a member field's possible values. |
| List the possible values of an enumerated custom field, finding the custom field by internal name, optionally filtering by parent value id | adFields/name/<name>/possibleValues[/<parentId>] | GET | Path variable name: the desired custom field's internal name Path variable parentId: optional numeric identifier of a possible value of the field's parent, to only get values belonging to that parent |
Array of the same objects as getting a member field's possible values. |
Allows searching and getting data about advertisement categories
| Service | URI | HTTP method | Input | Result |
| Get details of an advertisement category | adCategories/<id> | GET | Path variable id: numeric identifier | Object with the following properties:
|
| Get all categories | adCategories | GET | none | Array of the same objects as get category by id |