Cloud Storage for Natal Charts#
We have 5 endpoints to deal with cloud storage. All these endpoints are protected (see access levels).
/api/cloud/natal-charts/save/
/api/cloud/natal-charts/
/api/cloud/natal-charts/<id>/
/api/cloud/natal-charts/update/<id>/
/api/cloud/natal-charts/delete/<id>/
Save the Chart#
/api/cloud/natal-charts/save/
Use this endpoint to save the natal chart in the database. The user's email is extracted from the auth. header and associated with the saved chart. This endpoint additionally checks the data provided before saving the chart.
Request#
Method POST
Value | Type | Required | Comment |
---|---|---|---|
year | int | yes | In the range 1950..2100 |
month | int | yes | 1..12 |
day | int | yes | |
hour | int | yes | |
minute | int | yes | |
second | int | no | |
tz | float | yes | Timezone (UTC offset in hours), e.g., -3.5 means minus 3 hours and 30 minutes latitudes |
ln_d | int | yes | Longitude degrees 0..180 |
ln_m | int | yes | Longitude minutes 0..59 |
dir_ln | str | yes | east-west direction. Can be e or w |
lt_d | int | yes | Latitude degrees 0..90 |
lt_m | int | yes | Latitude minutes 0..59 |
dir_lt | str | yes | north-south direction. Can be n or s |
fortune | str | no | 0 to use reversed PoF, 1 to use a day-only formula. Default is 1 |
name | str | yes | A name of the person (nativity), max len = 100 |
note | str | no | A text field |
house_system | str | no | 'R' for Regiomontanus and 'P' for Placidus. Default is 'R' |
List the Charts#
/api/cloud/natal-charts/
Use this endpoint to display all or search through the charts associated with the given user. A user's credentials are taken from the auth. header in the request.
Request#
Method GET
Value | Type | Required | Comment |
---|---|---|---|
search | str | no | If given, then the API endpoint will search that string in thename field of the DB among all charts saved by the user |
page | int | no | The output list is paginated with 10 results per page. With this parameter you can browse the pages |
If search
(search query) is not provided, this endpoint will return all the charts saved by the user.
If page
value is not set, the default output starts with the 1st page.
Response#
{
"count": 237, // total number of charts
"next": "http://localhost/api/cloud/horary-charts/?page=2",
"previous": null, // links to prev|nex pages
"results": [
{
"id": 2,
"date_added": "2023-09-27T18:22:31.638673Z",
"user_email": "...@gmail.com",
"year": 2023,
"month": 8,
"day": 1,
"hour": 12,
"minute": 15,
"second": 0,
"tz": 3.0,
"ln_d": 37,
"ln_m": 37,
"dir_ln": "e",
"lt_d": 55,
"lt_m": 45,
"dir_lt": "n",
"name": "Test Person",
"notes": "test",
"house_system": "R"
},
// ..etc
]
}
Retrieve a Chart#
/api/cloud/horary-charts/<id>/
Use this endpoint to get details of the given chart.
Request#
Method GET
Value | Type | Required | Comment |
---|---|---|---|
id | int | yes | The id of the chart. |
The chart with the given id should be created by the same user who makes a request.
Response#
{
"id": 2,
"date_added": "2023-09-27T18:22:31.638673Z",
"user_email": "...@gmail.com",
"year": 2023,
"month": 8,
"day": 1,
"hour": 12,
"minute": 15,
"second": 0,
"tz": 3.0,
"ln_d": 37,
"ln_m": 37,
"dir_ln": "e",
"lt_d": 55,
"lt_m": 45,
"dir_lt": "n",
"name": "Test Person",
"notes": "test",
"house_system": "R"
}
Update the Chart#
/api/cloud/natal-charts/update/<id>/
Use this endpoint to update existing chart.
Request#
Method PATCH
Value | Type | Required | Comment |
---|---|---|---|
id | int | yes | The id of the chart. |
Any field | field type | The same fields as here here | User can modify any of the existing fields of the chart. |
The chart with the given id should be created by the same user who makes a request for the modification being effective.
Delete the Chart#
/api/cloud/natal-charts/delete/<id>/
Use this endpoint to delete the chart.
Request#
Method DELETE
Value | Type | Required | Comment |
---|---|---|---|
id | int | yes | The id of the chart |
Only the user who creates the chart can delete it.
Response#
Statis 204 - deleted
.