From 132e404e8e0c87c2b78f7b088a56d19ea837a6dd Mon Sep 17 00:00:00 2001 From: David Weitzman Date: Thu, 11 Jun 2020 09:00:04 -0700 Subject: [PATCH] Update README Signed-off-by: David Weitzman --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0640cb3c..eca0d002 100644 --- a/README.md +++ b/README.md @@ -383,7 +383,32 @@ Takes an HTTP POST with a JSON body of the form e.g. } ``` The service will return an http 200 if this request is allowed (if no ratelimits exceeded) or 429 if one or more -ratelimits were exceeded. Endpoint does not currently return detailed information on which limits were exceeded. +ratelimits were exceeded. + +The response is a RateLimitResponse encoded with +[proto3-to-json mapping](https://developers.google.com/protocol-buffers/docs/proto3#json): +```json +{ + "overallCode": "OVER_LIMIT", + "statuses": [ + { + "code": "OVER_LIMIT", + "currentLimit": { + "requestsPerUnit": 1, + "unit": "MINUTE" + } + }, + { + "code": "OK", + "currentLimit": { + "requestsPerUnit": 2, + "unit": "MINUTE" + }, + "limitRemaining": 1 + } + ] +} +``` # Debug Port