-
Notifications
You must be signed in to change notification settings - Fork 7
API planning
In the long run DiMe should perhaps follow Principles of good RESTful API Design, for example using PUT
and PATCH
for updating existing objects instead of POST
'ing with the id given. But for now we'll stick with the old way in order to be consistent with the rest of the DiMe API.
Also API versioning should be introduced at some point, e.g. /api/v1
, /api/v2
and so on.
These are DiMe-specific things, not user account specific, and thus do not require authentication.
GET /api/ping
GET /api/dime_id
POST api/profile
(adding new profile, profile name response: profile ID)
POST api/profile
(modifying a profile if the ID is given in the posted data)
GET api/profile/{ID}
(get the content of profile, what is in the profile?)
DELETE api/profile/{ID}
(deleting obviously)
POST api/profile
with the data:
{
name: “Kai’s formula profile”,
search_keywords: [“x”, “y”, ],
tags: ["tag1", "tag2"],
}
DiMe response:
{
id: 83724,
name: “Kai’s formula profile”,
search_keywords: [“x”, “y”, ],
tags: ["tag1", "tag2"],
}
register model (register name, get ID?)
Get list of n most common tags.
GET /api/tag/most_common
[{
id: 38093,
name: "reknow",
eventsCount: 30,
elementsCount: 28,
actors: ["KEA 1.0", "lucene"],
lastAdded: timestamp,
},
]
Get events for tag with given id
GET /api/tag/events/38093
GET /api/tag/informationelements/38093
POST /api/accounts/
supplied parameters: username, password, email(optional?)
curl -X POST \
-H "Content-Type: application/json" \
-d '{"username":"testuser","password":"testuser123","email":"[email protected]"}' \
http://<>/api/accounts/
response:
Status: 201 Created Location: https://<>/api/accounts/<user_id>
POST /api/account/remove
supplied parameters: username
POST /api/account/recover
supplied parameters: email
Also, backwards compatibility is an issue, since people have not supplied emails earlier
DiMe event count DiMe document count DiMe status, active loggers, API activity (log)