juno.fanfic.dev
Depending on which domain the service is accessed through, there may or may not be a /juno prefix to these endpoints.
GET /juno/v0/remote: Returns the client's remote address as seen by juno. This is not json encoded -- it is a raw string. Ex:
127.0.0.1
GET /juno/v0/status: Returns the status of the service, as well as the client's current burst request limit. If everything is well err should be 0 and status should be "ok". Ex:
{"burst":4,"err":0,"pid":101844,"status":"ok","tident":140189852665600}
POST /juno/v0/fic/{ficId}/refresh
apiKey={key}:
Request a refresh of a fic by id. The body should contain an
apiKey.
On success, a JSON response with an updated property will be returned, signalling whether an update was detected. This generally means that there is now a differing number of chapters, or the upstream source is no longer available:
{"msg":"updated","updated":true}
{"msg":"fic is now abandoned","updated":true}
{"msg":"no updates","updated":false}
A request that successfully communicated with the backend may return a response indicating that the fic already has a recent known update, or was recently requested to be refreshed and a new refresh was not attempted:
{"msg":"was updated recently","updated":false}
{"msg":"was fetched recently","updated":false}
General Errors
In general, if a response has a negative err code in a json body then there was an error issued by the api codebase. If there is a positive err code in a json body, then the error was issued by the application framework or web server and the numeric value will match the http status code.
status 401: unauthorized, ensure any required basic auth parameters are being passed. Ex:
{"err":401,"msg":"Unauthorized","nginx":true}
status 404: file not found, ensure the url is a valid api endpoint. Ex:
{"err":-404,"msg":"not found"}
status 429: too many requests; a Retry-After header will be included with minimum integer number of seconds before the client should make another request. A json response body with the same field will be included, ex:
{"err":-429,"msg":"too many requests","retryAfter":5}
status 500: internal server error. Either juno is misconfigured, or there's an outage somewhere in the pipeline.