Enterprise Risk Diagnostics API¶
Enterprise Risk Diagnostics API will holds Enterprise Risk Diagnostics data related to the users.
Service Description¶
The service-description will show following information for an API:
Gives the Python Version the API using
Gives the list of all installed Python packages
Gives the name of API
Gives all the available versions
Gives a list of middleware being used
Gives all available routes for each versions.
Method: GET
Example Response:
{
"status_code": 200,
"request_id": "c83bc540-2510-441b-881c-c053379d061c",
"data": {
"python_version": "3.6.8",
"installed_packages": [
"alabaster==0.7.12",
"asn1crypto==0.24.0",
...
],
"name": "user-data",
"versions": [
"v2",
"v2"
],
"middleware": [
"RequestResponseMiddleware",
"AuthenticationMiddleware",
"ResponseGeneratorMiddleware"
],
"routes": {
"v2": {
"preference": [
"delete",
"get",
"post",
"put"
],
"user-preference": [
"delete",
"get",
"post",
"put"
],
...
},
"v2": {
...
}
}
}
}
Query Expression Resource¶
-
class
v1.resources.query_expression.QueryExpressionResource¶ RDT Query Expression Resource
Note
Allowed Methods: GET / POST
GET Method¶
-
QueryExpressionResource.on_get(req, resp, gid: int = None)¶ Query Expression GET Method
Request
Method:
GETURL 1: https://stag.api.ranenetwork.com/rdt/v1/query-expression
URL 2: https://stag.api.ranenetwork.com/rdt/v1/query-expression/<gid>
Response Object:
{ "status_code": 200, "request_id": <Request UUID>, "data": [ { "expression_gid": <Expression GID, Integer>, "expression": <Query Exp Text> }, ... ] }
POST Method¶
-
QueryExpressionResource.on_post(req, resp)¶ Query Expression POST Method
Request
Method:
POSTURL 1: https://stag.api.ranenetwork.com/rdt/v1/query-expression
- Request Object::
- [
- {
“expression_gid”: <Expression GID, Integer>, “expression”: <Query Exp Text>
]
Response Object:
{ "status_code": 200, "request_id": <Request UUID>, "data": [ { "expression_gid": <Expression GID, Integer>, "expression": <Query Exp Text> }, ... ] }
RDT Topic Resource¶
-
class
v1.resources.rdt_topic.RDTTopicResource¶ RANE RDT Topics Resource
Endpoint for managing Topics, Query Expressions
Note
Allowed Methods: GET / POST / DELETE
GET Method¶
-
RDTTopicResource.on_get(req, resp, risk_area_id: int = None)¶ RDT Topic GET Method
Request
Method:
GETURL 1: https://stag.api.ranenetwork.com/rdt/v1/rdt-topic/<risk_area_id>
Response Object:
{ "status_code": 200, "request_id": <Request UUID>, "data": [ { "topic_gid": <topic_gid, Integer>, "query_exps": [ { "gid": <Query Exp GID, Integer>, "text": <Query expression text, Text>, }, ... ], "sources": [<list of source gids, Integer>], "risk_areas": [<list of risk area ids, Integer>] }, ... ] }
POST Method¶
-
RDTTopicResource.on_post(req, resp, risk_area_id: int)¶ RDT Topic POST Method
add topics and query expressions to a risk area
Request
Method:
POSTURL: https://stag.api.ranenetwork.com/rdt/v1/rdt-topic/<risk-area-id>
Request Object:
[ { "topic_gid": <topic_gid, Integer>, "query_exps": [ { "gid": <Query Exp GID, Integer>, "text": <Query expression text, Text>, }, ... ], "sources": [<list of source gids, Integer>] }, ... ]
Response Object:
{ "status_code": 200, "request_id": <Request UUID>, "data": [ { "topic_gid": <topic_gid, Integer>, "query_exps": [ { "gid": <Query Exp GID, Integer>, "text": <Query expression text, Text>, }, ... ], "sources": [<list of source gids, Integer>] }, ... ] } }
DELETE Method¶
-
RDTTopicResource.on_delete(req, resp, topic_gid: int = None)¶ RDT Topic Relationship Delete Method
Deletes all relationships for a given topic gid
Request
Method:
DELETEURL: https://stag.api.ranenetwork.com/rdt/v1/rdt-topic/del/<topic_gid>
Response Object
{ "status_code": 200, "request_id": <Request UUID>, "data": {} }
Trending Media Graph Resource¶
-
class
v1.resources.trending_media.TrendingMediaGraphResource¶ RDT Trending Media Graph Resource .. note:: Allowed Methods: POST
Trending Media Articles Resource¶
-
class
v1.resources.trending_media.TrendingMediaArticlesResource¶ RDT Trending Media Articles Resource .. note:: Allowed Methods: POST
POST Method¶
-
TrendingMediaArticlesResource.on_post(req, resp)¶ Trending Media Articles POST Method
Request
Method:
POSTURL 1: https://stag.api.ranenetwork.com/rdt/v1/trending-media-articles
Request Object:
{ "from": 1586006035, // utc epoch seconds "page": 1, // starts with page 1 "size": 3, // number of articles per page "risk_area_id": 1 // integer risk area idea }
Response Object:
{ "status_code": 200, "request_id": "9f55a1d5-b275-4703-821f-093d40011fe6", "data": { "articles": [ { "snippet": "A second wave of coronavirus....", "article_published_on": 1587556800, "sources": [ { "article_url_domain": "bbc.com", "external_source_id": 27, "ingested_on": 1587591160, "name": "BBC-DisplayName", "published_on": 1587556800, "article_url": "https://www.bbc.com/news/world-us-canada-52378845" } ], "title": "Coronavirus: US Health Official Warns of Dangerous Second Wave" }, {}, ... ], "total": 9 } }
RDT Events Resource¶
-
class
v1.resources.event.EventsResource¶
GET Method¶
-
EventsResource.on_get(req, resp, risk_area_id: int = None)¶ RDT Event GET Method
Request
Method:
GETURL 1: https://stag.api.ranenetwork.com/rdt/v1/event/<risk_area_id>?from_date=<unix time stamp for from date>
Response Object:
{ "status_code": 200, "request_id": <Request UUID>, "data": [ { "id" : <Integer, Event ID>, "risk_area" : <Integer, Risk Area ID>, "note" : <Text, Note for event>, "event_date" : <Timestamp, Event date>, "articles" : <List, List of article gids related to event> } ... ] }
POST Method¶
-
EventsResource.on_post(req, resp, risk_area_id: int = None)¶ RDT event POST Method
Request
Method:
POSTURL 1: https://stag.api.ranenetwork.com/rdt/v1/event/<risk_area_id>
Request Object:
{ "note" : <Text, Note for event>, "event_date" : <Timestamp, Event date>, "articles" : <List, List of article gids related to event> }
Response Object:
{ "status_code": 200, "request_id": <Request UUID>, "data": [ { "id" : <Integer, Event ID>, "risk_area" : <Integer, Risk Area ID>, "note" : <Text, Note for event>, "event_date" : <Timestamp, Event date>, "articles" : <List, List of article gids related to event> } ... ] }