wiki:front_end/rest/endpoints
  • Information in always returned as JSON
  • Used verbs are GET PUT POST DELETE.
  • REST is level 3 compliant.

Endpoints of the REST interface for UI

Resources are listed from simplest to most complex

Currencies

view currency

Method: GET

Structure:

/ui/rest/currency/([a-z,A-Z]{3})

Example:

/ui/rest/currency/EUR

Return value:

{"name": "Euro", "decimal_places": 2, "code": "EUR"}

view list of all currencies

Method: GET

Structure:

/ui/rest/currency

endpoint supports paging:

/ui/rest/currency/?limit=10&offset=20

Return value:

[{
	"name": "United Arab Emirates dirham",
	"decimal_places": 2,
	"code": "AED"
}, {
	"name": "Argentine peso",
	"decimal_places": 2,
	"code": "ARS"
}, {
	"name": "Australian dollar",
	"decimal_places": 2,
	"code": "AUD"
}, {
	"name": "Canadian dollar",
	"decimal_places": 2,
	"code": "CAD"
}, {
	"name": "Suiss Franc",
	"decimal_places": 2,
	"code": "CHF"
}, {
	"name": "Chilean peso",
	"decimal_places": 0,
	"code": "CLP"
}, {
	"name": "Chinese yuan",
	"decimal_places": 2,
	"code": "CNY"
}, {
	"name": "Colombian peso",
	"decimal_places": 2,
	"code": "COP"
}]

Add new currency or change existing currency

Method: PUT

Structure:

/ui/rest/currency/([a-z,A-Z]{3})
where code is the 3-letter ISO currency code

Body:

{"code":"DZD","name":"Algerian Dinar","decimal_places":2}

Return value:

{"code":0, "message": "GBP has been inserted or updated."}

Delete existing currency

Method: DELETE

Structure:

/ui/rest/currency/(?P=code)
where code is the 3-letter ISO currency code

Return value:

{"message": "EUR has been deleted.", "code": 0}

Countries

View country

Method: GET

Structure:

/ui/rest/country/(?P=code)

Example:

/ui/rest/country/DE

Return value:

[{
		"name": "Germany",
		"code": "DE"
	},
	[{
		"name": "Deutschland",
		"language": "de_DE"
	}, {
		"name": "Germany",
		"language": "en_EN"
	}, {
		"name": "Allemagne",
		"language": "fr_FR"
	}, {
		"name": "Germania",
		"language": "it_IT"
	}, {
		"name": "Alemanha",
		"language": "pt_PT"
	}]
]

List countries

Method: GET

Structure:

/ui/rest/country/

Return value:

[{
	"name": "Antigua and Barbuda",
	"code": "AG"
}, {
	"name": "ALbania",
	"code": "AL"
}, {
	"name": "Armenia",
	"code": "AM"
}, {
	"name": "Andorra",
	"code": "AN"
}, {
	"name": "Angola",
	"code": "AO"
}]

Paging is possible with limit and offset parameters.

Update or Insert new country

Method: PUT

Structure:

/ui/rest/country/([a-z,A-Z]{2})

Example:

/ui/rest/country/AZ

Body if only the country without any translated country names is updated or inserted:

[{"code":"AZ","name":"Azerbaijan"}]

Body including translated country names:

[{
		"code": "AZ",
		"name": "Azerbaijan"
	},
	[{
		"language": "de_DE",
		"name": "Aserbaidschan"
	}, {
		"language": "en_GB",
		"name": "Azerbaijan"
	}, {
		"language": "fr_FR",
		"name": "Azerbaïdjan"
	}]
]

Return value:

{"message": "AZ has been inserted or updated.", "code": 0}

Update or Insert a translated name for an existing country

Method: PUT Structure:

/ui/rest/country/([a-z,A-Z]{2})/([a-z]{2}_[A-Z]{2}

Example:

/ui/rest/country/AZ/es_ES

Body:

{"language":"es_ES","name":"Azerbaiyán"}

Delete a country

Method: DELETE Structure:

/ui/rest/country/([a-z,A-Z]{2})

Example:

/ui/rest/country/AZ

Delete a single translation of the country name

Method: DELETE Structure:

/ui/rest/country/([a-z,A-Z]{2})/([a-z]{2}_[A-Z]{2}

Example:

/ui/rest/country/AZ/es_ES
Last modified 11 months ago Last modified on Oct 2, 2017 1:42:41 PM