***************************************
*
* API Documentation
*
***************************************

This is the documentation for the REST-like API of the Date Converter for
Ancient Egypt website (http://egypt.online-resourcen.de/Date_Converter_for_Ancient_Egypt)
which is a scientific tool for converting calendar dates mentioned in Greek and
Demotic Papyri from Egypt into Julian and corresponding Gregorian dates, from the
reign of Psametik to Diocletian. All calculations are based on the tables in Skeat,
Reigns of the Ptolemies (1969), Pestman, Chronologie égyptienne d'après les textes
démotiques (1967), Pestman, Les papyrus démotiques de Tsenhor (1994) and Grzybek, Du
calendrier macédonien au calendrier ptolémaique (1990).

*******************
* Table of Contents
*******************

1. Query format
2. Response Format
3. Changelog
4. Contact

*****************
* 1. Query Format
*****************

The generic URI pattern is as following:

http://online-resourcen.de/api/:period/:reign/:year/:month/:day

All URI path segment parameters are mandatory, except :day which is optional (see below).

:period
*******
can have one of the fowllowing values:
    latePeriod
    ptolemies
    romanEmperors

:reign
******
the numeric ID of a reign; depending on :period it can has one of the following values:

for :period = 'latePeriod' (allowed values: 1 .. 24):

    1 => Psametik I
    2 => Necho
    3 => Psametik II
    4 => Apries
    5 => Amasis
    6 => Psametik III
    7 => Cambyses
    8 => Darius I
    9 => Xerxes I
    10 => Artaxerxes
    11 => Darius II
    12 => Artaxerxes II
    13 => Amyrtaeos
    14 => Nepherites I
    15 => Achoris
    16 => Psammuthis
    17 => Nepherites II
    18 => Nektanebo I
    10 => Theos
    20 => Nektanebo II
    21 => Artaxerxes III
    22 => Arses
    23 => Darius III
    24 => Khababash

for :period = 'ptolemies' (allowed values: 1 .. 26):

    1 => Alexander III (the Great)
    2 => Philip Arrhidaeus
    3 => Alexander IV
    4 => Ptolemy I Soter
    5 => Ptolemy II Philadelphus
    6 => Ptolemy III Euergetes
    7 => Ptolemy IV Philopator
    8 => Ptolemy V Epiphanes
    9 => Ptolemy VI Philometor
    10 => Ptolemy VI Philometor, Ptolemy VIII (Euergetes II) and Cleopatra II
    11 => Ptolemy VIII (Euergetes II) alone
    12 => Ptolemy VI Philometor and Cleopatra II restored
    13 => Ptolemy VII Neos Philopator
    14 => Ptolemy VIII Euergetes II restored
    15 => Cleopatra III and Ptolemy IX Soter II (Lathyros)
    16 => Cleopatra III and Ptolemy X Alexander I
    17 => Ptolemy X Alexander I and Cleopatra III
    18 => Ptolemy X Alexander I and Cleopatra Berenice
    19 => Ptolemy IX Soter II (Lathyros) restored
    20 => Cleopatra Berenice (afterwards with Ptolemy XI Alexander II)
    21 => Ptolemy XII Neos Dionysos (Auletes)
    22 => Berenice IV (at first with Cleopatra Tryphaena)
    23 => Berenice IV and Archelaus
    24 => Archelaus and Berenice IV
    25 => Ptolemy XII Neos Dionysos (Auletes) restored
    26 => Cleopatra VII Philopator

for :period = 'romanEmperors' (allowed values: 1 .. 40):

    1 => Augustus
    2 => Tiberius
    3 => Caligula
    4 => Claudius
    5 => Nero
    6 => Galba
    7 => Otho
    8 => Vitellius
    9 => Vespasian
    10 => Titus
    11 => Domitian
    12 => Nerva
    13 => Trajan
    14 => Hadrian
    15 => Antoninus Pius
    16 => Marc Aurel
    17 => Commodus
    18 => Pertinax
    19 => Pescennius Niger
    20 => Septimius Severus
    21 => Caracalla
    22 => Macrinus
    23 => Elagabal
    24 => Severus Alexander
    25 => Maximinus Thrax
    27 => Gordian
    28 => Phillippus Arabs
    29 => Decius
    30 => Gallus / Volusian
    31 => Aemilian
    32 => Valerian
    33 => Macrianus / Quietus
    34 => Gallienus
    35 => Claudius Gothicus
    36 => Aurelian
    37 => Tacitus
    38 => Probus
    39 => Carus / Carinus
    40 => Diocletian

:year
*****
numeric value of the year of the given reign

:month
******
numeric index number of month (allowed values: 1 .. 13):
    1  => Thoth     (1. month of Achet)
    2  => Phaophi   (2. month of Achet)
    3  => Hathyr    (3. month of Achet)
    4  => Choiak    (4. month of Achet)
    5  => Tybi      (1. month of Peret)
    6  => Mecheir   (2. month of Peret)
    7  => Phamenoth (3. month of Peret)
    8  => Pharmuthi (4. month of Peret)
    9  => Pachons   (1. month of Shemu)
    10 => Payni     (2. month of Shemu)
    11 => Epeiph    (3. month of Shemu)
    12 => Mesore    (4. month of Shemu)
    13 => epagomenal days

:day
****
numeric value for the day of the given month; this parameter is optional. Allowed
values are in a range between 1 and 30. Not specifying :day will result in
calculation of both the first and last day of the given month (a date range in the
response instead of a single day response type).


Examples:
*********

http://online-resourcen.de/api/ptolemies/24/1/1/2
http://online-resourcen.de/api/ptolemies/24/1/1



********************
* 2. Response Format
********************

All responses will be in simple JSON format.

First look out for the status key which shows either "success" or "error"
(with a hint on what went wrong).

Depending on your query there is as result either
(1) a single day ("type" => "day") or
(2) a date range ("type" => "range"),
both are wrapped in a "data" attribute.

example for (1):
****************

{
	"status": "success",
	"apiVersion": "0.11",
	"data": {
		"type": "day",
		"dateJulian": "-0052-09-06",
		"dateGregorian": "-0052-09-04",
		"egyptianDateString": "year 1 of Cleopatra VII Philopator, Thoth, day 2",
		"JD": 1702678.5
	}
}


example for (2):
****************

{
	"status": "success",
	"apiVersion": "0.11",
	"data": {
		"type": "range",
		"dateRangeStart": {
			"dateJulian": "-0052-09-05",
			"dateGregorian": "-0052-09-03",
			"egyptianDateString": "year 1 of Cleopatra VII Philopator, Thoth, day 1",
			"JD": 1702677.5
		},
		"dateRangeEnd": {
			"dateJulian": "-0052-10-04",
			"dateGregorian": "-0052-10-02",
			"egyptianDateString": "year 1 of Cleopatra VII Philopator, Thoth, day 30",
			"JD": 1702706.5
		}
	}
}


**************
* 3. Changelog
**************

version 0.11 : Added Julian Day Number to JSON Response (2017-01-01)
version 0.1  : First version of the REST-like API (2015-09-07).

************
* 4. Contact
************

If you encounter any issues feel free to contact me:
frank.grieshaber@zaw.uni-heidelberg.de