mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
Merge pull request #151 from spiral-project/jd-fix-domain
Change ihatemoney.notmyidea.org → ihatemoney.org
This commit is contained in:
commit
fb69e8aa89
1 changed files with 15 additions and 18 deletions
33
docs/api.rst
33
docs/api.rst
|
@ -23,12 +23,9 @@ To interact with bills and members, and to do something else than creating
|
||||||
a project, you need to be authenticated. The only way to authenticate yourself
|
a project, you need to be authenticated. The only way to authenticate yourself
|
||||||
currently is using the "basic" HTTP authentication.
|
currently is using the "basic" HTTP authentication.
|
||||||
|
|
||||||
If you don't want your credentials to pass in clear trought the network, you
|
|
||||||
can use the ssl endpoint at https://ihatemoney.notmyidea.org
|
|
||||||
|
|
||||||
For instance, here is how to see the what's in a project, using curl::
|
For instance, here is how to see the what's in a project, using curl::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo http://ihatemoney.notmyidea.org/api/projects/demo
|
$ curl --basic -u demo:demo https://ihatemoney.org/api/projects/demo
|
||||||
|
|
||||||
Projects
|
Projects
|
||||||
--------
|
--------
|
||||||
|
@ -50,7 +47,7 @@ A project needs the following arguments:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
$ curl -X POST https://ihatemoney.notmyidea.org/api/projects \
|
$ curl -X POST https://ihatemoney.org/api/projects \
|
||||||
-d 'name=yay&id=yay&password=yay&contact_email=yay@notmyidea.org'
|
-d 'name=yay&id=yay&password=yay&contact_email=yay@notmyidea.org'
|
||||||
"yay"
|
"yay"
|
||||||
|
|
||||||
|
@ -62,7 +59,7 @@ Getting information about the project
|
||||||
Getting information about the project::
|
Getting information about the project::
|
||||||
|
|
||||||
|
|
||||||
$ curl --basic -u demo:demo http://ihatemoney.notmyidea.org/api/projects/demo
|
$ curl --basic -u demo:demo https://ihatemoney.org/api/projects/demo
|
||||||
{
|
{
|
||||||
"name": "demonstration",
|
"name": "demonstration",
|
||||||
"contact_email": "demo@notmyidea.org",
|
"contact_email": "demo@notmyidea.org",
|
||||||
|
@ -85,7 +82,7 @@ Updating a project
|
||||||
Updating a project is done with the `PUT` verb::
|
Updating a project is done with the `PUT` verb::
|
||||||
|
|
||||||
$ curl --basic -u yay:yay -X PUT\
|
$ curl --basic -u yay:yay -X PUT\
|
||||||
http://ihatemoney.notmyidea.org/api/projects/yay -d\
|
https://ihatemoney.org/api/projects/yay -d\
|
||||||
'name=yay&id=yay&password=yay&contact_email=youpi@notmyidea.org'
|
'name=yay&id=yay&password=yay&contact_email=youpi@notmyidea.org'
|
||||||
|
|
||||||
Deleting a project
|
Deleting a project
|
||||||
|
@ -93,14 +90,14 @@ Deleting a project
|
||||||
|
|
||||||
Just send a DELETE request ont the project URI ::
|
Just send a DELETE request ont the project URI ::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo -X DELETE http://ihatemoney.notmyidea.org/api/projects/demo
|
$ curl --basic -u demo:demo -X DELETE https://ihatemoney.org/api/projects/demo
|
||||||
|
|
||||||
Members
|
Members
|
||||||
-------
|
-------
|
||||||
|
|
||||||
You can get all the members with a `GET` on `/api/projects/<id>/members`::
|
You can get all the members with a `GET` on `/api/projects/<id>/members`::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo http://ihatemoney.notmyidea.org/api/projects/demo/members\
|
$ curl --basic -u demo:demo https://ihatemoney.org/api/projects/demo/members\
|
||||||
[{"activated": true, "id": 31, "name": "Arnaud"},
|
[{"activated": true, "id": 31, "name": "Arnaud"},
|
||||||
{"activated": true, "id": 32, "name": "Alexis"},
|
{"activated": true, "id": 32, "name": "Alexis"},
|
||||||
{"activated": true, "id": 33, "name": "Olivier"},
|
{"activated": true, "id": 33, "name": "Olivier"},
|
||||||
|
@ -109,20 +106,20 @@ You can get all the members with a `GET` on `/api/projects/<id>/members`::
|
||||||
Add a member with a `POST` request on `/api/projects/<id>/members`::
|
Add a member with a `POST` request on `/api/projects/<id>/members`::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo -X POST\
|
$ curl --basic -u demo:demo -X POST\
|
||||||
http://ihatemoney.notmyidea.org/api/projects/demo/members -d 'name=tatayoyo'
|
https://ihatemoney.org/api/projects/demo/members -d 'name=tatayoyo'
|
||||||
35
|
35
|
||||||
|
|
||||||
You can also `PUT` a new version of a member (changing its name)::
|
You can also `PUT` a new version of a member (changing its name)::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo -X PUT\
|
$ curl --basic -u demo:demo -X PUT\
|
||||||
http://ihatemoney.notmyidea.org/api/projects/demo/members/36\
|
https://ihatemoney.org/api/projects/demo/members/36\
|
||||||
-d 'name=yeaaaaah'
|
-d 'name=yeaaaaah'
|
||||||
{"activated": true, "id": 36, "name": "yeaaaaah"}
|
{"activated": true, "id": 36, "name": "yeaaaaah"}
|
||||||
|
|
||||||
Delete a member with a `DELETE` request on `/api/projects/<id>/members/<member-id>`::
|
Delete a member with a `DELETE` request on `/api/projects/<id>/members/<member-id>`::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo -X DELETE\
|
$ curl --basic -u demo:demo -X DELETE\
|
||||||
http://ihatemoney.notmyidea.org/api/projects/demo/members/35
|
https://ihatemoney.org/api/projects/demo/members/35
|
||||||
"OK
|
"OK
|
||||||
|
|
||||||
Bills
|
Bills
|
||||||
|
@ -130,7 +127,7 @@ Bills
|
||||||
|
|
||||||
You can get the list of bills by doing a `GET` on `/api/projects/<id>/bills` ::
|
You can get the list of bills by doing a `GET` on `/api/projects/<id>/bills` ::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo http://ihatemoney.notmyidea.org/api/projects/demo/bills
|
$ curl --basic -u demo:demo https://ihatemoney.org/api/projects/demo/bills
|
||||||
|
|
||||||
Add a bill with a `POST` query on `/api/projects/<id>/bills`. you need the
|
Add a bill with a `POST` query on `/api/projects/<id>/bills`. you need the
|
||||||
following params:
|
following params:
|
||||||
|
@ -144,20 +141,20 @@ following params:
|
||||||
Returns the id of the created bill ::
|
Returns the id of the created bill ::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo -X POST\
|
$ curl --basic -u demo:demo -X POST\
|
||||||
http://ihatemoney.notmyidea.org/api/projects/demo/bills\
|
https://ihatemoney.org/api/projects/demo/bills\
|
||||||
-d "date=2011-09-10&what=raclette&payer=31&payed_for=31&payed_for=35&amount=200"
|
-d "date=2011-09-10&what=raclette&payer=31&payed_for=31&amount=200"
|
||||||
80
|
80
|
||||||
|
|
||||||
You can also `PUT` a new version of the bill at
|
You can also `PUT` a new version of the bill at
|
||||||
`/api/projects/<id>/bills/<bill-id>`::
|
`/api/projects/<id>/bills/<bill-id>`::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo -X PUT\
|
$ curl --basic -u demo:demo -X PUT\
|
||||||
http://ihatemoney.notmyidea.org/api/projects/demo/bills/80\
|
https://ihatemoney.org/api/projects/demo/bills/80\
|
||||||
-d "date=2011-09-10&what=raclette&payer=31&payed_for=31&payed_for=35&amount=250"
|
-d "date=2011-09-10&what=raclette&payer=31&payed_for=31&amount=250"
|
||||||
80
|
80
|
||||||
|
|
||||||
And you can of course `DELETE` them at `/api/projects/<id>/bills/<bill-id>`::
|
And you can of course `DELETE` them at `/api/projects/<id>/bills/<bill-id>`::
|
||||||
|
|
||||||
$ curl --basic -u demo:demo -X DELETE\
|
$ curl --basic -u demo:demo -X DELETE\
|
||||||
http://ihatemoney.notmyidea.org/api/projects/demo/bills/80\
|
https://ihatemoney.org/api/projects/demo/bills/80\
|
||||||
"OK"
|
"OK"
|
||||||
|
|
Loading…
Reference in a new issue