All requests require username and a password header. These should match some of the credentials in the configuration file. You also need a Content-Type header set to application/json
For an error response, the server will return a JSON with a single key- error, which has a short message describing the error. On a 2xx error code, the key is instead message.
To get the existing links, make a GET request to /simpleshortener_admin_api/list. This returns a JSON file with the links field having a key:value list of shortening:destination.
You can add new links by making a PUT request to /simpleshortener_admin_api/add with the JSON data
{
"link": "shorturl",
"destination": "https://example.com"
}
You can delete links by making a DELETE request to /simpleshortener_admin_api/delete with the JSON data
{
"link": "shorturl"
}
You can edit existing links by making a PATCH request to /simpleshortener_admin_api/edit with the JSON data
{
"link": "shorturl",
"destination": "https://example.com"
}