From ee2dc720b12be4c11a63028b387cbc9b25d3059f Mon Sep 17 00:00:00 2001 From: VinneyJ Date: Tue, 16 Jul 2024 09:41:41 +0300 Subject: [PATCH 1/4] chore: fix port, remove port on doc URLs --- apps/docker-compose.dist.yml | 2 +- doc/api_2_0_spec/admin_api_2_0_spec.md | 48 +++---- doc/api_2_0_spec/api_2_0_spec.md | 94 +++++++------- doc/api_2_0_spec/topics_api_2_0_spec.md | 164 ++++++++++++------------ 4 files changed, 154 insertions(+), 154 deletions(-) diff --git a/apps/docker-compose.dist.yml b/apps/docker-compose.dist.yml index dbdd60b5d5..bd0419a8ff 100644 --- a/apps/docker-compose.dist.yml +++ b/apps/docker-compose.dist.yml @@ -2113,7 +2113,7 @@ services: # Public HTTP port # (SSL is done by Nginx running on bastion host) # MAKE SURE to BLOCK THIS PORT in provision/roles/docker/tasks/iptables.yml - - "8082:80" + - "80:80" volumes: # Shared with "cron_generate_daily_rss_dumps" container: - vol_daily_rss_dumps:/mediacloud_webapp_static/static/rss_dumps/ diff --git a/doc/api_2_0_spec/admin_api_2_0_spec.md b/doc/api_2_0_spec/admin_api_2_0_spec.md index 9aa1c48996..2622f091c2 100644 --- a/doc/api_2_0_spec/admin_api_2_0_spec.md +++ b/doc/api_2_0_spec/admin_api_2_0_spec.md @@ -163,11 +163,11 @@ Media Cloud API 2.0 Spec for a more detailed description of the `q` and `fq` par The output of these calls is in exactly the same format as for the api/v2/stories/single call. -URL: https://api.mediacloud.org/api/v2/stories/list?last_processed_stories_id=8625915 +URL: https://aapp.civicsignal.africag/api/v2/stories/list?last_processed_stories_id=8625915 Return a stream of all stories processed by Media Cloud, greater than the `last_processed_stories_id`. -URL: https://api.mediacloud.org/api/v2/stories/list?last_processed_stories_id=2523432&q=text:obama+AND+media_id:1 +URL: https://app.civicsignal.africa/api/v2/stories/list?last_processed_stories_id=2523432&q=text:obama+AND+media_id:1 Return a stream of all stories from The New York Times mentioning `'obama'` greater than the given `last_processed_stories_id`. @@ -195,7 +195,7 @@ This call updates a single existing story. ### Example -URL: https://api.mediacloud.org/api/v2/stories/update +URL: https://app.civicsignal.africa/api/v2/stories/update Input: @@ -229,7 +229,7 @@ Output: Fetch raw CLIFF annotation for stories 1, 2 and a nonexistent story 3: -URL: https://api.mediacloud.org/api/v2/stories/cliff?stories_id=1&stories_id=2&stories_id=3 +URL: https://app.civicsignal.africa/api/v2/stories/cliff?stories_id=1&stories_id=2&stories_id=3 Response: @@ -281,7 +281,7 @@ Response: Fetch raw NYTLabels annotation for stories 1, 2 and a nonexistent story 3: -URL: https://api.mediacloud.org/api/v2/stories/nytlabels?stories_id=1&stories_id=2&stories_id=3 +URL: https://app.civicsignal.africa/api/v2/stories/nytlabels?stories_id=1&stories_id=2&stories_id=3 Response: @@ -351,7 +351,7 @@ rows parameter. Fetch sentences containing the stem 'vaccin*' -URL: https://api.mediacloud.org/api/v2/sentences/list?q=vaccin* +URL: https://app.civicsignal.africa/api/v2/sentences/list?q=vaccin* ```json [ @@ -452,7 +452,7 @@ for each tag_set included in the list of tags other than the tags added by this ### Example -URL: https://api.mediacloud.org/aip/v2/stories/put_tags +URL: https://app.civicsignal.africa/aip/v2/stories/put_tags Input: @@ -497,7 +497,7 @@ Output: ### Example -https://api.mediacloud.org/api/v2/tags/create +https:///api/v2/tags/create Input: @@ -541,7 +541,7 @@ See api/v2/tags/create above. The update call also requires a tags_id field ### Example -https://api.mediacloud.org/api/v2/tags/update +https://app.civicsignal.africa/api/v2/tags/update Input: @@ -584,7 +584,7 @@ Output: ### Example -https://api.mediacloud.org/api/v2/tag_sets/update/ +https://app.civicsignal.africa/api/v2/tag_sets/update/ Input: @@ -622,7 +622,7 @@ See tags/create above. The tag_sets/update call also requires a tag_sets_id fie ### Example -https://api.mediacloud.org/api/v2/tag_sets/update +https://app.civicsignal.africa/api/v2/tag_sets/update Input: @@ -678,7 +678,7 @@ The `active = true` (the default) will cause the feed to be regularly crawled. Create a new feed in media_id 1: -URL: https://api.mediacloud.org/api/v2/feeds/create +URL: https://app.civicsignal.africa/api/v2/feeds/create Input: @@ -720,7 +720,7 @@ See api/v2/feeds/create above. The input document can contain any subset of fie Update the `active` of feed 1 to `false`. -URL: https://api.mediacloud.org/api/v2/feeds/update +URL: https://app.civicsignal.africa/api/v2/feeds/update Input: @@ -908,7 +908,7 @@ The output is always a list of records with the fields described above. The out ### Example -URL: https://api.mediacloud.org/api/v2/media/create (PUT) +URL: https://app.civicsignal.africa/api/v2/media/create (PUT) Input: @@ -957,7 +957,7 @@ See api/v2/media/create end point above for possible input fields. The input re ### Example -URL: https://api.mediacloud.org/api/v2/media/update +URL: https://app.civicsignal.africa/api/v2/media/update Input: @@ -991,17 +991,17 @@ Suggestions will be listed in the order that they were submitted. ### Example -URL: https://api.mediacloud.org/api/v2/media/list_suggestions +URL: https://app.civicsignal.africa/api/v2/media/list_suggestions Output: ```json [ { - "email": "hroberts@mediacloud.org", + "email": "hroberts@app.civicsignal.africa", "auth_users_id": 123, - "url": "http://mediacloud.org", - "feed_url": "http://mediacloud.org/feed/", + "url": "http://app.civicsignal.africa", + "feed_url": "http://app.civicsignal.africa/feed/", "reason": "Media Cloud is a great project", "tags_ids": [ 123, 456 ], "date_submitted": "2016-11-20 07:42:00", @@ -1036,7 +1036,7 @@ Note that marking a suggestion as approved does not automatically create the med ### Example -URL: https://api.mediacloud.org/api/v2/media/mark_suggestion +URL: https://app.civicsignal.africa/api/v2/media/mark_suggestion Input: @@ -1088,7 +1088,7 @@ See `api/v2/users/list` below for sample output. ### Example -URL: https://api.mediacloud.org/api/v2/users/list?search=foo +URL: https://app.civicsignal.africa/api/v2/users/list?search=foo Output: @@ -1171,7 +1171,7 @@ All of the input fields other than ### Example -URL: https://api.mediacloud.org/api/v2/users/update +URL: https://app.civicsignal.africa/api/v2/users/update Input: @@ -1208,7 +1208,7 @@ This call deletes a single existing user. ### Example -URL: https://api.mediacloud.org/api/v2/users/update +URL: https://app.civicsignal.africa/api/v2/users/update Input: @@ -1236,7 +1236,7 @@ none. ### Example -URL: https://api.mediacloud.org/api/v2/users/list\_roles +URL: https://app.civicsignal.africa/api/v2/users/list\_roles Output: diff --git a/doc/api_2_0_spec/api_2_0_spec.md b/doc/api_2_0_spec/api_2_0_spec.md index 4df1d603d8..803753b40b 100644 --- a/doc/api_2_0_spec/api_2_0_spec.md +++ b/doc/api_2_0_spec/api_2_0_spec.md @@ -176,15 +176,15 @@ Every call below includes a `key` parameter which will authenticate the user to To get a key, register for a user: -https://topics.mediacloud.org/#/user/signup +https://topics.civicsignal.africa/#/user/signup Once you have an account go here to see your key: -https://topics.mediacloud.org/#/user/profile +https://topics.civicsignal.africa/#/user/profile ### Example -https://api.mediacloud.org/api/v2/media/single/1?key=KRN4T5JGJ2A +https://app.civicsignal.africa/api/v2/media/single/1?key=KRN4T5JGJ2A ## Python Client @@ -233,7 +233,7 @@ The Media Cloud returns an appropriate HTTP status code for any error, along wit ## Request Limits Each user is limited to 1,000 API calls and 20,000 stories returned in any 7 day period. Requests submitted beyond this -limit will result in a status 403 error. Users who need access to more requests should email info@mediacloud.org. +limit will result in a status 403 error. Users who need access to more requests should email civicsignal@codeforafrica.org. # Media @@ -255,7 +255,7 @@ None. Fetching information on The New York Times -URL: https://api.mediacloud.org/api/v2/media/single/1 +URL: https://app.civicsignal.africa:80/api/v2/media/single/1 Response: @@ -339,7 +339,7 @@ If the `q` parameter is specified, return only media that include at least on se All tags specified in the `tags\_id` parameter are OR'd together. Additonal lists of tags can be specified in numbered tags_id lists, eg. `tags\_id\_1`. Each set of numbered tag lists will be AND'd together. -URL: https://api.mediacloud.org/api/v2/media/list?last_media_id=1&rows=2 +URL: https://app.civicsignal.africa/api/v2/media/list?last_media_id=1&rows=2 Output format is the same as for api/v2/media/single above. @@ -363,7 +363,7 @@ This API end point allows the user to send a suggest a new media source to the M ### Example -URL: https://api.mediacloud.org/api/v2/media/submit_suggestion +URL: https://app.civicsignal.africa/api/v2/media/submit_suggestion Input: ```json @@ -432,7 +432,7 @@ volume. More details are in the field descriptions below Fetch media health information for media source 4438: -https://api.mediacloud.org/api/v2/mediahealth/list?media_id=4438 +https://app.civicsignal.africa/api/v2/mediahealth/list?media_id=4438 Response: @@ -498,7 +498,7 @@ None. ### Example -URL: https://api.mediacloud.org/api/v2/feeds/single/1 +URL: https://app.civicsignal.africa/api/v2/feeds/single/1 ```json [ @@ -528,7 +528,7 @@ URL: https://api.mediacloud.org/api/v2/feeds/single/1 ### Example -URL: https://api.mediacloud.org/api/v2/feeds/list?media_id=1 +URL: https://app.civicsignal.africa/api/v2/feeds/list?media_id=1 Output format is the same as for api/v2/feeds/single above. @@ -569,7 +569,7 @@ The following table describes the meaning and origin of fields returned by both Note: This fetches data on the CC licensed Global Voices story ["Myanmar's new flag and new name"](http://globalvoicesonline.org/2010/10/26/myanmars-new-flag-and-new-name/#comment-1733161) from November 2010. -URL: https://api.mediacloud.org/api/v2/stories_public/single/27456565 +URL: https://app.civicsignal.africa/api/v2/stories_public/single/27456565 ```json @@ -644,11 +644,11 @@ an error. The output of these calls is in exactly the same format as for the api/v2/stories_public/single call. -URL: https://api.mediacloud.org/api/v2/stories_public/list?last_processed_stories_id=8625915 +URL: https://app.civicsignal.africa/api/v2/stories_public/list?last_processed_stories_id=8625915 Return a stream of all stories processed by Media Cloud, greater than the `last_processed_stories_id`. -URL: https://api.mediacloud.org/api/v2/stories_public/list?last_processed_stories_id=2523432&q=text:obama+AND+media_id:1 +URL: https://app.civicsignal.africa/api/v2/stories_public/list?last_processed_stories_id=2523432&q=text:obama+AND+media_id:1 Return a stream of all stories from The New York Times mentioning `'obama'` greater than the given `last_processed_stories_id`. @@ -674,7 +674,7 @@ If split is specified, split the counts into periods set by split_period. Count stories containing the word 'obama' in The New York Times. -URL: https://api.mediacloud.org/api/v2/stories_public/count?q=obama&fq=media_id:1 +URL: https://app.civicsignal.africa/api/v2/stories_public/count?q=obama&fq=media_id:1 ```json { @@ -684,7 +684,7 @@ URL: https://api.mediacloud.org/api/v2/stories_public/count?q=obama&fq=media_id: Count stories containing 'africa' in the New York Times for each week from 2014-01-01 to 2014-03-01: -URL: https://api.mediacloud.org/api/v2/stories_public/count?split=1&split_period=week&q=africa%20AND%20media_id%3A1%20AND%20publish_day%3A%5B2014-01-01T00%3A00%3A00Z%20TO%202014-03-01T00%3A00%3A00Z%5D +URL: https://app.civicsignal.africa/api/v2/stories_public/count?split=1&split_period=week&q=africa%20AND%20media_id%3A1%20AND%20publish_day%3A%5B2014-01-01T00%3A00%3A00Z%20TO%202014-03-01T00%3A00%3A00Z%5D ```json { @@ -749,7 +749,7 @@ s applied before the tag_sets_id parameter, so fewer than limit (or zero) result Count tags in stories containing the word 'obama' in The New York Times. -URL: https://api.mediacloud.org/api/v2/stories_public/tag_count?q=obama&fq=media_id:1&limit=3 +URL: https://app.civicsignal.africa/api/v2/stories_public/tag_count?q=obama&fq=media_id:1&limit=3 ```json [ @@ -909,7 +909,7 @@ Setting the 'stats' field to true changes the structure of the response, as show Get word frequency counts for all sentences containing the word `'obama'` in The New York Times -URL: +URL: ```json [ @@ -949,7 +949,7 @@ URL: Get word frequency counts for all sentences containing the word `'obama'` in The New York Times, with stats data included -URL: +URL: ```json @@ -1040,7 +1040,7 @@ tag set. Fetching information on the tag 8876989. -URL: https://api.mediacloud.org/api/v2/tags/single/8875027 +URL: https://app.civicsignal.africa/api/v2/tags/single/8875027 Response: @@ -1092,7 +1092,7 @@ returned. ### Example -URL: https://api.mediacloud.org/api/v2/tags/list?rows=2&tag_sets_id=5&last_tags_id=8875026 +URL: https://app.civicsignal.africa/api/v2/tags/list?rows=2&tag_sets_id=5&last_tags_id=8875026 ## api/v2/tag_sets/single/ @@ -1124,7 +1124,7 @@ tag set. Fetching information on the tag set 5. -URL: https://api.mediacloud.org/api/v2/tag_sets/single/5 +URL: https://app.civicsignal.africa/api/v2/tag_sets/single/5 Response: @@ -1158,7 +1158,7 @@ None. ### Example -URL: https://api.mediacloud.org/api/v2/tag_sets/list +URL: https://app.civicsignal.africa/api/v2/tag_sets/list # Registration and Authentication @@ -1216,7 +1216,7 @@ After successful registraction, user is sent an email inviting him to open a lin #### Example -URL: +URL: Input: @@ -1227,7 +1227,7 @@ Input: "full_name": "Foo Bar", "notes": "Just feeling like it.", "has_consented": 1, - "activation_url": "https://dashboard.mediacloud.org/activate" + "activation_url": "https://dashboard.civicsignal.africa/activate" } ``` @@ -1280,7 +1280,7 @@ Output: #### Example -URL: +URL: Input: @@ -1342,14 +1342,14 @@ For the description of `activation_url`, see `auth/register`. #### Example -URL: +URL: Input: ```json { "email": "foo@bar.baz", - "activation_url": "https://dashboard.mediacloud.org/activate" + "activation_url": "https://dashboard.civicsignal.africa/activate" } ``` @@ -1409,14 +1409,14 @@ After successful send password reset API call, user is sent an email inviting hi #### Example -URL: +URL: Input: ```json { "email": "foo@bar.baz", - "password_reset_url": "https://dashboard.mediacloud.org/reset_password" + "password_reset_url": "https://dashboard.civicsignal.africa/reset_password" } ``` @@ -1467,7 +1467,7 @@ Output: #### Example -URL: +URL: Input: @@ -1532,7 +1532,7 @@ API call is rate-limited. #### Example -URL: +URL: Input: @@ -1614,7 +1614,7 @@ Media Cloud currently includes the following authentication roles: #### Example -URL: +URL: ```json { @@ -1686,7 +1686,7 @@ Asking user to re-enter password and comparing the two values is left to the cli #### Example -URL: +URL: Input: @@ -1739,7 +1739,7 @@ None. #### Example -URL: +URL: Output: @@ -1779,7 +1779,7 @@ Output: ### Example -URL: https://api.mediacloud.org/api/v2/stats/list +URL: https://app.mcivicsignal.africa/api/v2/stats/list ```json { @@ -1814,7 +1814,7 @@ Detect whether a given block of content is likely to be ap syndicated content by ### Example -URL: https://api.mediacloud.org/api/v2/util/is_syndicated_ap +URL: https://app.civicsignal.africa/api/v2/util/is_syndicated_ap Input: @@ -1846,7 +1846,7 @@ import pkg_resources import requests assert pkg_resources.get_distribution("requests").version >= '1.2.3' -r = requests.get('https://api.mediacloud.org/api/v2/media/list', +r = requests.get('https://app.civicsignal.africa/api/v2/media/list', params = params, headers = { 'Accept': 'application/json'}, headers = { 'Accept': 'application/json'} @@ -1864,7 +1864,7 @@ rows = 1000 while True: params = { 'last_media_id': last_media_id, 'rows': rows, 'key': MY_KEY } print "last_media_id:{} rows:{}".format( last_media_id, rows) - r = requests.get( 'https://api.mediacloud.org/api/v2/media/list', params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://app.civicsignal.africa/api/v2/media/list', params = params, headers = { 'Accept': 'application/json'} ) data = r.json() if len(data) == 0: @@ -1892,7 +1892,7 @@ with open( '/tmp/media.csv', 'wb') as csvfile: This is broken down into multiple steps for convenience and because that's probably how a real user would do it. The you almost always want to search by a specific media source or media collection. The easiest way to find a relevant media -collection is to use our [Sources Tool](https://sources.mediacloud.org). The URL for a the US Mainstream Media media collection in +collection is to use our [Sources Tool](https://sources.civicsignal.africa). The URL for a the US Mainstream Media media collection in the sources tool looks like this: https://sources.mediacloud.org/#media-tag/8875027/details @@ -1914,7 +1914,7 @@ while True: params = { 'last_processed_stories_id': start, 'rows': rows, 'q': 'tags_id_media:8875027', 'key': MY_KEY } print "Fetching {} stories starting from {}".format( rows, start) - r = requests.get( 'https://api.mediacloud.org/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://app.civicsignal.africa/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) stories = r.json() if len(stories) == 0: @@ -1955,7 +1955,7 @@ while True: } print "Fetching {} stories starting from {}".format( rows, start) - r = requests.get( 'https://api.mediacloud.org/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://app.civicsignal.africa/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) stories = r.json() if len(stories) == 0: @@ -1979,13 +1979,13 @@ One way to appropriately restrict the data is by setting the `q` parameter to re Below `q` is set to `"text:trayvon"` and `fq` is set to `"tags_iud_media:8875027" and "publish_date:[2012-04-01T00:00:00.000Z TO 2013-05-01T00:00:00.000Z]"`. (Note that ":", "[", and "]" are URL encoded.) ```bash -curl 'https://api.mediacloud.org/api/v2/wc?q=text:trayvon&fq=tags_iud_media:8875027&fq=publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D' +curl 'https://app.civicsignal.africa/api/v2/wc?q=text:trayvon&fq=tags_iud_media:8875027&fq=publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D' ``` Alternatively, we could use a single large query by setting `q` to `"text:trayvon AND tags_id_media:8875027 AND publish_date:[2012-04-01T00:00:00.000Z TO 2013-05-01T00:00:00.000Z]"`: ```bash -curl 'https://api.mediacloud.org/api/v2/wc?q=text:trayvon+AND+tags_id_media:8875027+AND+publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D&fq=tags_id_media:8875027&fq=publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D' +curl 'https://app.civicsignal.africa/api/v2/wc?q=text:trayvon+AND+tags_id_media:8875027+AND+publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D&fq=tags_id_media:8875027&fq=publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D' ``` @@ -1997,7 +1997,7 @@ curl 'https://api.mediacloud.org/api/v2/wc?q=text:trayvon+AND+tags_id_media:8875 The user requests a list of all tag sets. ```bash -curl https://api.mediacloud.org/api/v2/tag_sets/list +curl https://app.civicsignal.africa/api/v2/tag_sets/list ``` ```json @@ -2029,7 +2029,7 @@ def find_tags_id( tag_name, tag_sets_id): while True: params = { 'last_tags_id': last_tags_id, 'rows': rows, 'key': MY_KEY } print "start:{} rows:{}".format( start, rows) - r = requests.get( 'https://api.mediacloud.org/api/v2/tags/list/' + tag_sets_id , params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://app.civicsignal.africa/api/v2/tags/list/' + tag_sets_id , params = params, headers = { 'Accept': 'application/json'} ) tags = r.json() if len(tags) == 0: @@ -2050,7 +2050,7 @@ Assume that the user determined that the `tags_id` was 12345678 using the above the word count for all sentences in stories belonging to any media source associated with tag 12345678. ```bash -curl 'https://api.mediacloud.org/api/v2/wc?q=tags_id_media:12345678' +curl 'https://app.civicsignal.africa/api/v2/wc?q=tags_id_media:12345678' ``` ## Grab stories from 10 January 2014 with the tag `'foo:bar'` @@ -2076,7 +2076,7 @@ while True: params = { 'last_processed_stories_id': start, 'rows': rows, 'q': 'tags_id_stories:678910', 'key': MY_KEY } print "Fetching {} stories starting from {}".format( rows, start) - r = requests.get( 'https://api.mediacloud.org/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://app.civicsignal.africa/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) stories = r.json() if len(stories) == 0: diff --git a/doc/api_2_0_spec/topics_api_2_0_spec.md b/doc/api_2_0_spec/topics_api_2_0_spec.md index dbf50a9be7..c3300801a5 100644 --- a/doc/api_2_0_spec/topics_api_2_0_spec.md +++ b/doc/api_2_0_spec/topics_api_2_0_spec.md @@ -218,11 +218,11 @@ data. All URLs in the topics API are in the form: -`https://api.mediacloud.org/api/v2/topics//stories/list` +`https://app.civicsignal.africa/api/v2/topics//stories/list` For example, the following will return all stories in the latest snapshot of topic id 1344. -`https://api.mediacloud.org/api/v2/topics/1344/stories/list` +`https://app.civicsignal.africa/api/v2/topics/1344/stories/list` ## Snapshots, Timespans, and Foci @@ -298,7 +298,7 @@ For example, the following is a paged response: After receiving that response, you can use the following URL with no other parameters to fetch the next page of results: -`https://api.mediacloud.org/api/v2/topics/1/stories/list?link_id=789123` +`https://app.civicsignal.africa/api/v2/topics/1/stories/list?link_id=789123` When the system has reached the end of the results, it will return an empty list and a nullĀ 'next' *link_id*. @@ -329,7 +329,7 @@ represents the set of stories active in a topic within a given date range. Ever ## `topics/create` (POST) -`https://api.mediacloud.org/api/v2/topics/create` +`https://app.civicsignal.africa/api/v2/topics/create` Create and return a new *topic*. @@ -345,7 +345,7 @@ The topics/create call accepts as input the following fields described in the Ou Create a new topic: -`https://api.mediacloud.org/api/v2/topics/create` +`https://app.civicsignal.africa/api/v2/topics/create` Input: @@ -401,7 +401,7 @@ Response: ## `topics//update` (PUT) -`https://api.mediacloud.org/api/v2/topics//update` +`https://app.civicsignal.africa/api/v2/topics//update` Edit an existing *topic*. @@ -425,7 +425,7 @@ Accepts the same input as the topics/create call. Edit the 'immigration 2015' topic. -`https://api.mediacloud.org/api/v2/topics/1390/update` +`https://app.civicsignal.africa/api/v2/topics/1390/update` Input: @@ -468,7 +468,7 @@ Response: ``` ## `topics/info` (GET) -`https://api.mediacloud.org/api/v2/topics/info +`https://app.civicsignal.africa/api/v2/topics/info Get a list of modes, sources, and platforms supported by media cloud. @@ -478,7 +478,7 @@ Get a list of modes, sources, and platforms supported by media cloud. ### Example -`https://api.mediacloud.org/api/v2/topics/info` +`https://app.civicsignal.africa/api/v2/topics/info` Nore that the below response is only an example. The data returned by this call will change over time. @@ -584,7 +584,7 @@ Response: ## `topics//add_seed_query` (PUT) -`https://api.mediacloud.org/api/v2/topics//add_seed_query` +`https://app.civicsignal.africa/api/v2/topics//add_seed_query` Add a seed query to an existing topic. If the same seed querty already exists, do nothing. Returns the created or found seed query. @@ -608,7 +608,7 @@ To get the list of allowed sources and platforms, see the topics/info end point. Add a crimson hexagon twitter search: -`https://api.mediacloud.org/api/v2/topics/1390/add_seed_query` +`https://app.civicsignal.africa/api/v2/topics/1390/add_seed_query` Input: @@ -638,7 +638,7 @@ Response: ## `topics//remove_seed_query` (PUT) -`https://api.mediacloud.org/api/v2/topics//remove_seed_query` +`https://app.civicsignal.africa/api/v2/topics//remove_seed_query` Remove an existing topic seed query. @@ -655,7 +655,7 @@ Remove an existing topic seed query. Remove a seed query: -`https://api.mediacloud.org/api/v2/topics/1390/remove_seed_query` +`https://app.civicsignal.africa/api/v2/topics/1390/remove_seed_query` Input: @@ -673,7 +673,7 @@ Response: ## topics//reset (PUT) -`https://api.mediacloud.org/api/v2/topics/~topics_id~/reset` +`https://app.civicsignal.africa/api/v2/topics/~topics_id~/reset` Delete all existing stories, links, and seed urls from an existing *topic*. Set the topic state to 'created but not queued' and the message to null. @@ -696,7 +696,7 @@ This call will return an error if it is run on a *topic* with a state of 'runnin Reset the 'immigration 2015' topic. -`https://api.mediacloud.org/api/v2/topics/1390/reset` +`https://app.civicsignal.africa/api/v2/topics/1390/reset` Response: @@ -708,7 +708,7 @@ Response: ## `topics//spider` (POST) -`https://api.mediacloud.org/api/v2/topics//spider` +`https://app.civicsignal.africa/api/v2/topics//spider` Start a topic spidering job. @@ -733,7 +733,7 @@ The call returns a `job_state` record with information about the state of the qu Start a topic spider for the 'U.S. 2016 Election' topic: -`https://api.mediacloud.org/api/v2/topics/1404/spider` +`https://app.civicsignal.africa/api/v2/topics/1404/spider` Input: @@ -762,7 +762,7 @@ Response: ## `topics//spider_status` -`https://api.mediacloud.org/api/v2/topics//spider_status` +`https://app.civicsignal.africa/api/v2/topics//spider_status` Get a list all spidering jobs started for this topic. @@ -784,7 +784,7 @@ Get a list all spidering jobs started for this topic. ### Example -`https://api.mediacloud.org/api/v2/topics/1404/spider_status` +`https://app.civicsignal.africa/api/v2/topics/1404/spider_status` Response: @@ -805,7 +805,7 @@ Response: ## `topics/list` -`https://api.mediacloud.org/api/v2/topics/list` +`https://app.civicsignal.africa/api/v2/topics/list` The topics/list call returns a simple list of topics available in Media Cloud. The call will only return topics for which the calling user has read or higher permissions. @@ -850,7 +850,7 @@ Standard parameters accepted: link_id. Fetch all topics in Media Cloud: -`https://api.mediacloud.org/api/v2/topics/list` +`https://app.civicsignal.africa/api/v2/topics/list` Response: @@ -922,7 +922,7 @@ Response: ## `topics/single/` -`https://api.mediacloud.org/api/v2/topics/single/` +`https://app.civicsignal.africa/api/v2/topics/single/` The topics/single call returns a single topic, if the calling user has permission to read that topic. @@ -938,7 +938,7 @@ The topics/single call returns a single topic, if the calling user has permissio Fetch a single topic: -`https://api.mediacloud.org/api/v2/topics/single/672` +`https://app.civicsignal.africa/api/v2/topics/single/672` Response: @@ -978,7 +978,7 @@ Response: ## `topics//list_timespan_files` -`https://api.mediacloud.org/api/v2/topics//list_timespan_files` +`https://app.civicsignal.africa/api/v2/topics//list_timespan_files` List all timespan\_files associated with the given timespan. Timespan files are dumps made by the spider during the snapshotting process. @@ -997,7 +997,7 @@ during the snapshotting process. ### Example -`https://api.mediacloud.org/api/v2/topics/123/list_timespan_files` +`https://app.civicsignal.africa/api/v2/topics/123/list_timespan_files` Response: @@ -1015,7 +1015,7 @@ Response: ## `topics//list_snapshot_files` -`https://api.mediacloud.org/api/v2/topics//list_snapshot_files` +`https://app.civicsignal.africa/api/v2/topics//list_snapshot_files` List all snapshot\_files associated with the given snapshot. Snapshot files are dumps made by the spider during the snapshotting process. Snapshot files are only accessible by users with admin access. @@ -1034,7 +1034,7 @@ during the snapshotting process. Snapshot files are only accessible by users wit ### Example -`https://api.mediacloud.org/api/v2/topics/123/list_snapshot_files` +`https://app.civicsignal.africa/api/v2/topics/123/list_snapshot_files` Response: @@ -1056,7 +1056,7 @@ Response: ## `topics/permissions/user/list` -`https://api.mediacloud.org/api/v2/topics/permissions/user/list` +`https://app.civicsignal.africa/api/v2/topics/permissions/user/list` List all permissions assigned to the authenticated user for all topics. This list includes only permissions granted specifically to this user. Topics available for reading through the 'public' flag are not included in this list. @@ -1076,7 +1076,7 @@ List all permissions assigned to the authenticated user for all topics. This li List all permissions belonging to the authenticated user: -`https://api.mediacloud.org/api/v2/topics/permissions/user/list` +`https://app.civicsignal.africa/api/v2/topics/permissions/user/list` Response: @@ -1095,7 +1095,7 @@ Response: ## `topics//permissions/list` -`https://api.mediacloud.org/api/v2/topics//permissions/list` +`https://app.civicsignal.africa/api/v2/topics//permissions/list` List all permissions for the given topic. @@ -1111,7 +1111,7 @@ List all permissions for the given topic. List all permissions belonging to the given topic: -`https://api.mediacloud.org/api/v2/topics/1394/permissions/list` +`https://app.civicsignal.africa/api/v2/topics/1394/permissions/list` Response: @@ -1136,7 +1136,7 @@ Response: ## `topics//permissions/update` (PUT) -`https://api.mediacloud.org/api/v2/topics//permissions/update` +`https://app.civicsignal.africa/api/v2/topics//permissions/update` Update permissions for a given user to a given topic. @@ -1161,7 +1161,7 @@ On success, the new permission is returned in the same format as the permissions Update the permissions for a given user for a given topic: -`https://api.mediacloud.org/api/v2/topics//permissions/update` +`https://app.civicsignal.africa/api/v2/topics//permissions/update` Input: @@ -1195,7 +1195,7 @@ Response: ## `stories/list` -`https://api.mediacloud.org/api/v2/topics//stories/list` +`https://app.civicsignal.africa/api/v2/topics//stories/list` The stories list call returns stories in the topic. @@ -1246,7 +1246,7 @@ Standard parameters accepted: snapshots_id, foci_id, timespans_id, limit, link_i Fetch all stories in topic id 1344: -`https://api.mediacloud.org/api/v2/topics/1344/stories/list` +`https://app.civicsignal.africa/api/v2/topics/1344/stories/list` Response: @@ -1287,7 +1287,7 @@ Response: ## `stories/links` -`https://api.mediacloud.org/api/v2/topics//stories/links` +`https://app.civicsignal.africa/api/v2/topics//stories/links` Return all links between individual stories across media within the given topic. @@ -1306,7 +1306,7 @@ Standard parameters accepted : snapshots_id, foci_id, timespans_id, limit. Return links for topic 1404: -`https://api.mediacloud.org/api/v2/topics/1404/stories/links?limit=3` +`https://app.civicsignal.africa/api/v2/topics/1404/stories/links?limit=3` Response: @@ -1335,7 +1335,7 @@ Response: ## `stories/facebook` -`https://api.mediacloud.org/api/v2/topics//stories/facebook` +`https://app.civicsignal.africa/api/v2/topics//stories/facebook` Return the current facebook counts for all stories in the topic. Note that this call returns the current facebook count data, which may change over time, rather than the snapshotted, static data returned by the @@ -1358,7 +1358,7 @@ Standard parameters accepted : snapshots_id, foci_id, timespans_id, limit. Return the facebook counts for 3 stories in the given topic. -`https://api.mediacloud.org/api/v2/topics/1404/stories/facebook?limit=3` +`https://app.civicsignal.africa/api/v2/topics/1404/stories/facebook?limit=3` Response: @@ -1393,7 +1393,7 @@ Response: ## `stories/count` -`https://api.mediacloud.org/api/v2/topics//stories/count` +`https://app.civicsignal.africa/api/v2/topics//stories/count` Return the number of stories that match the query. @@ -1417,7 +1417,7 @@ Standard parameters accepted : snapshots_id, foci_id, timespans_id, limit. Return the number of stories that mention 'immigration' in the 'US Election' topic: -`https://api.mediacloud.org/api/v2/topics//stories/count?q=immigration` +`https://app.civicsignal.africa/api/v2/topics//stories/count?q=immigration` Response: @@ -1430,7 +1430,7 @@ Response: ## `sentences/count` -`https://api.mediacloud.org/api/v2/topics//sentences/count` +`https://app.civicsignal.africa/api/v2/topics//sentences/count` Return the numer of sentences that match the query, optionally split by date. @@ -1445,7 +1445,7 @@ For details about this end point, including parameters, output, and examples, se ## `media/list` -`https://api.mediacloud.org/api/v2/topics//media/list` +`https://app.civicsignal.africa/api/v2/topics//media/list` The media list call returns the list of media in the topic. @@ -1488,7 +1488,7 @@ Standard parameters accepted: snapshots_id, foci_id, timespans_id, limit, link_i Return all stories in the medium that match 'twitt': -`https://api.mediacloud.org/api/v2/topics//media/list?name=twitt` +`https://app.civicsignal.africa/api/v2/topics//media/list?name=twitt` Response: @@ -1531,7 +1531,7 @@ Response: ## `media/links` -`https://api.mediacloud.org/api/v2/topics//media/links` +`https://app.civicsignal.africa/api/v2/topics//media/links` Return all links between individual media within the given topic. @@ -1550,7 +1550,7 @@ Standard parameters accepted : snapshots_id, foci_id, timespans_id, limit. Return links for topic 1404: -`https://api.mediacloud.org/api/v2/topics/1404/media/links?limit=3` +`https://app.civicsignal.africa/api/v2/topics/1404/media/links?limit=3` Response: @@ -1579,7 +1579,7 @@ Response: ## `media/map` -`https://api.mediacloud.org/api/v2/topics//media/map` +`https://app.civicsignal.africa/api/v2/topics//media/map` The media list call returns a gexf formatted network map of the media in the topic / timespan. @@ -1609,12 +1609,12 @@ https://gephi.org/gexf/format/ Return the network map for topic id 12: -`https://api.mediacloud.org/api/v2/topics/12/media/map` +`https://app.civicsignal.africa/api/v2/topics/12/media/map` ## `media/list_maps` -`https://api.mediacloud.org/api/v2/topics//media/list_maps` +`https://app.civicsignal.africa/api/v2/topics//media/list_maps` Return a list of maps available within the timespan. @@ -1626,14 +1626,14 @@ None. Return the network map for topic id 12: -`https://api.mediacloud.org/api/v2/topics/12/media/list_maps` +`https://app.civicsignal.africa/api/v2/topics/12/media/list_maps` # Word Counts ## `wc/list` -`https://api.mediacloud.org/api/v2/topics//wc/list` +`https://app.civicsignal.africa/api/v2/topics//wc/list` Returns sampled counts of the most prevalent words in a topic, optionally restricted to sentences that match a given query. @@ -1672,7 +1672,7 @@ The Boolean Query focal technique associates a focus with a story by matching th ## `focal_set_definitions/create` (POST) -`https://api.mediacloud.org/api/topics//focal_set_definitions/create` +`https://app.civicsignal.africa/api/topics//focal_set_definitions/create` Create and return a new *focal set definiition* within the given *topic*. @@ -1692,7 +1692,7 @@ Create and return a new *focal set definiition* within the given *topic*. Create a 'Candidates' focal set definition in the 'U.S. 2016 Election' topic: -`https://api.mediacloud.org/api/v2/topics/1344/focal_set_definitions/create` +`https://app.civicsignal.africa/api/v2/topics/1344/focal_set_definitions/create` Input: @@ -1723,7 +1723,7 @@ Response: ## `focal_set_definitions//update` (PUT) -`https://api.mediacloud.org/api/v2/topics//focal_set_definitions//update/` +`https://app.civicsignal.africa/api/v2/topics//focal_set_definitions//update/` Update the given focal set definition. @@ -1739,7 +1739,7 @@ See *focal_set_definitions/create* for a list of fields. Only fields that are i Update the name and description of the 'Candidates' focal set"definition": -`https://api.mediacloud.org/api/v2/topics/1344/focal_set_definitions/789/update` +`https://app.civicsignal.africa/api/v2/topics/1344/focal_set_definitions/789/update` Input: @@ -1770,7 +1770,7 @@ Response: ## `focal_set_definitions//delete` (PUT) -`https://api.mediacloud.org/api/v2/topics//focal_set_definitions//delete` +`https://app.civicsignal.africa/api/v2/topics//focal_set_definitions//delete` Delete a focal set definition. @@ -1788,7 +1788,7 @@ Delete a focal set definition. Delete focal_set_definitions_id 123: -`https://api.mediacloud.org/api/v2/topics//focal_set_definitions/123/delete` +`https://app.civicsignal.africa/api/v2/topics//focal_set_definitions/123/delete` Response: @@ -1798,7 +1798,7 @@ Response: ## `focal_set_definitions/list` -`https://api.mediacloud.org/api/v2/topics//focal_set_definitions/list` +`https://app.civicsignal.africa/api/v2/topics//focal_set_definitions/list` Return a list of all focal set definitions belonging to the given topic. @@ -1821,7 +1821,7 @@ Return a list of all focal set definitions belonging to the given topic. List all focal set definitions associated with the 'U.S. 2016 Elections'"topic": -`https://api.mediacloud.org/api/v2/topics/1344/focal_set_definitions/list` +`https://app.civicsignal.africa/api/v2/topics/1344/focal_set_definitions/list` Response: @@ -1853,7 +1853,7 @@ Response: ## `focal_sets/list` -`https://api.mediacloud.org/api/v2/topics//focal_sets/list` +`https://app.civicsignal.africa/api/v2/topics//focal_sets/list` List all *focal sets* belonging to the specified *snapshot* in the given *topic*. @@ -1878,7 +1878,7 @@ If no snapshots_id is specified, the latest snapshot will be used. If foci_id o Get a list of *focal sets* in the latest *snapshot* in the 'U.S. 2016 Election' *topic*: -`https://api.mediacloud.org/api/v2/topics/1344/focal_sets_list` +`https://app.civicsignal.africa/api/v2/topics/1344/focal_sets_list` Response: @@ -1910,7 +1910,7 @@ Response: ## `focus_definitions/create` (POST) -`https://api.mediacloud.org/api/topics//focus_definitions/create` +`https://app.civicsignal.africa/api/topics//focus_definitions/create` Create and return a new *focus definition* within the given *topic* and *focal set definition*. @@ -1933,7 +1933,7 @@ The input for the *focus definition* depends on the focal technique of the paren Create the 'Clinton' *focus definition* within the 'Candidates' *focal set definition* and the 'U.S. 2016 Election' *topic*: -`https://api.mediacloud.org/api/v2/topics/1344/focus_definitions/create` +`https://app.civicsignal.africa/api/v2/topics/1344/focus_definitions/create` Input: @@ -1966,7 +1966,7 @@ Response: ## `focus_definitions//update` (PUT) -`https://api.mediacloud.org/api/v2/topics//focus_definitions//update` +`https://app.civicsignal.africa/api/v2/topics//focus_definitions//update` Update the given focus definition. @@ -1982,7 +1982,7 @@ See *focus_definitions/create* for a list of fields. Only fields that are inclu Update the query for the 'Clinton' focus definition: -`https://api.mediacloud.org/api/v2/topics/1344/focus_definitions/234/update` +`https://app.civicsignal.africa/api/v2/topics/1344/focus_definitions/234/update` Input: @@ -2008,7 +2008,7 @@ Response: ## `focus_definitions//delete` (PUT) -`https://api.mediacloud.org/api/v2/topics//focus_definitions//delete` +`https://app.civicsignal.africa/api/v2/topics//focus_definitions//delete` Delete a focus definition. @@ -2026,7 +2026,7 @@ Delete a focus definition. Delete focus_definitions_id 123: -`https://api.mediacloud.org/api/v2/topics//focus_definitions/123/delete` +`https://app.civicsignal.africa/api/v2/topics//focus_definitions/123/delete` Response: @@ -2036,7 +2036,7 @@ Response: ## `focus_definitions/list` -`https://api.mediacloud.org/api/v2/topics//focus_definitions//list` +`https://app.civicsignal.africa/api/v2/topics//focus_definitions//list` List all *focus definitions* belonging to the given *focal set definition*. @@ -2062,7 +2062,7 @@ method specific fields are listed last in the table above and are prefixed with List all *focus definitions* belonging to the 'Candidates' *focal set definition* of the 'U.S. 2016 Election' *topic*: -`https://api.mediacloud.org/api/v2/topics/1344/focus_definitions/234/list` +`https://app.civicsignal.africa/api/v2/topics/1344/focus_definitions/234/list` Response: @@ -2082,7 +2082,7 @@ Response: ## `foci/list` -`https://api.mediacloud.org/api/v2/topics//foci/list` +`https://app.civicsignal.africa/api/v2/topics//foci/list` Return a list of the *foci* belonging to the given *focal set*. @@ -2107,7 +2107,7 @@ The output for *focus* depends on the focal technique of the parent *focus defin Get a list of *foci* wihin the 'Candiates' *focal set* of the 'U.S. 2016 Election' *topic*: -`https://api.mediacloud.org/api/v2/topics/1344/foci/list?focal_sets_id=234` +`https://app.civicsignal.africa/api/v2/topics/1344/foci/list?focal_sets_id=234` Response: @@ -2131,7 +2131,7 @@ Each *snapshot* contains a static copy of all data within a topic at the time th ## `snapshots/create` (POST) -`https://api.mediacloud.org/api/v2/topics//snapshots/create` +`https://app.civicsignal.africa/api/v2/topics//snapshots/create` Create a new but empty snapshot for the topic. This call only creates an empty shell of a snapshot. To fill it with data, you must pass the returned snapshots\_id to snapshots/generate or topic/spider. @@ -2154,7 +2154,7 @@ Returns the created snapshot, as in the example below. Create a new snapshot for the 'U.S. 2016 Election' *topic*: -`https://api.mediacloud.org/api/v2/topics/1344/snapshots/create` +`https://app.civicsignal.africa/api/v2/topics/1344/snapshots/create` Response: @@ -2170,7 +2170,7 @@ Response: ## `snapshots/generate` (POST) -`https://api.mediacloud.org/api/v2/topics//snapshots/generate` +`https://app.civicsignal.africa/api/v2/topics//snapshots/generate` Generate a new *snapshot* for the given topic. Note that `topics/spider` will generate a snapshot as part of its spidering process, so this end point only needs to be called to generate an additional snapshot of a topic @@ -2199,7 +2199,7 @@ This command will return a job_state object as described in the `snapshots/gener Start a new *snapshot* generation job for the 'U.S. 2016 Election' *topic*: -`https://api.mediacloud.org/api/v2/topics/1344/snapshots/generate` +`https://app.civicsignal.africa/api/v2/topics/1344/snapshots/generate` Response: @@ -2218,7 +2218,7 @@ Response: ## `snapshots/generate_status` -`https://api.mediacloud.org/api/v2/topics//snapshots/generate_status` +`https://app.civicsignal.africa/api/v2/topics//snapshots/generate_status` Return a list of snapshots job_states for the given snapshot; @@ -2245,7 +2245,7 @@ Return a list of snapshots job_states for the given snapshot; List snapshot jobs for the 'U.S. 2016 Election' *topic*: -`https://api.mediacloud.org/api/v2/topics/1344/snapshots/generate_status` +`https://app.civicsignal.africa/api/v2/topics/1344/snapshots/generate_status` Response: @@ -2265,7 +2265,7 @@ Response: ## `snapshots/list` -`https://api.mediacloud.org/api/v2/topics//snapshots/list` +`https://app.civicsignal.africa/api/v2/topics//snapshots/list` Return a list of all completed *snapshots* in the given *topic*. @@ -2296,7 +2296,7 @@ few minutes up to a few hours. The 'searchable' field is set to true once that Return a list of *snapshots* in the 'U.S. 2016 Election' *topic*: -`https://api.mediacloud.org/api/v2/topics/1344/snapshots/list` +`https://app.civicsignal.africa/api/v2/topics/1344/snapshots/list` Response: @@ -2418,7 +2418,7 @@ word_vectors = gensim.models.KeyedVectors.load_word2vec_format('model.bin', bina ### Example -URL: +URL: Output: `application/octet-stream` model data of topic with `topics_id=6`, snapshot with `snapshots_id=1`, word2vec model with `models_id=1`. @@ -2431,7 +2431,7 @@ A *story* is included within a *timespan* if the publish_date of the story is wi ## `timespans/list` -`https://api.mediacloud.org/api/v2/topics//timespans/list` +`https://app.civicsignal.africa/api/v2/topics//timespans/list` Return a list of timespans in the current snapshot. @@ -2470,7 +2470,7 @@ Media Cloud needs to guess the date of many of the stories discovered while topi Return all *timespans* associated with the latest *snapshot* of the 'U.S. 2016 Election' *topic*: -`https://api.mediacloud.org/api/v2/topics/1344/timespans/list` +`https://app.civicsignal.africa/api/v2/topics/1344/timespans/list` Response: From b42619221a1cc511e72f4c4776c82d859ad53ec4 Mon Sep 17 00:00:00 2001 From: VinneyJ Date: Wed, 17 Jul 2024 15:02:46 +0300 Subject: [PATCH 2/4] fix: url typo in docs --- doc/api_2_0_spec/admin_api_2_0_spec.md | 2 +- doc/api_2_0_spec/api_2_0_spec.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api_2_0_spec/admin_api_2_0_spec.md b/doc/api_2_0_spec/admin_api_2_0_spec.md index 2622f091c2..cda174f184 100644 --- a/doc/api_2_0_spec/admin_api_2_0_spec.md +++ b/doc/api_2_0_spec/admin_api_2_0_spec.md @@ -163,7 +163,7 @@ Media Cloud API 2.0 Spec for a more detailed description of the `q` and `fq` par The output of these calls is in exactly the same format as for the api/v2/stories/single call. -URL: https://aapp.civicsignal.africag/api/v2/stories/list?last_processed_stories_id=8625915 +URL: https://app.civicsignal.africa/api/v2/stories/list?last_processed_stories_id=8625915 Return a stream of all stories processed by Media Cloud, greater than the `last_processed_stories_id`. diff --git a/doc/api_2_0_spec/api_2_0_spec.md b/doc/api_2_0_spec/api_2_0_spec.md index 803753b40b..34768f7b47 100644 --- a/doc/api_2_0_spec/api_2_0_spec.md +++ b/doc/api_2_0_spec/api_2_0_spec.md @@ -255,7 +255,7 @@ None. Fetching information on The New York Times -URL: https://app.civicsignal.africa:80/api/v2/media/single/1 +URL: https://app.civicsignal.africa/api/v2/media/single/1 Response: @@ -1280,7 +1280,7 @@ Output: #### Example -URL: +URL: Input: @@ -1779,7 +1779,7 @@ Output: ### Example -URL: https://app.mcivicsignal.africa/api/v2/stats/list +URL: https://app.civicsignal.africa/api/v2/stats/list ```json { From 0a86a02d2fe82782784902da66d3ce8f22a06402 Mon Sep 17 00:00:00 2001 From: VinneyJ Date: Wed, 17 Jul 2024 18:07:21 +0300 Subject: [PATCH 3/4] fix: typo in admin api doc --- doc/api_2_0_spec/admin_api_2_0_spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api_2_0_spec/admin_api_2_0_spec.md b/doc/api_2_0_spec/admin_api_2_0_spec.md index cda174f184..5918845418 100644 --- a/doc/api_2_0_spec/admin_api_2_0_spec.md +++ b/doc/api_2_0_spec/admin_api_2_0_spec.md @@ -452,7 +452,7 @@ for each tag_set included in the list of tags other than the tags added by this ### Example -URL: https://app.civicsignal.africa/aip/v2/stories/put_tags +URL: https://app.civicsignal.africa/api/v2/stories/put_tags Input: From ec336079595bacd9e991da3aa6042bbbe12d517c Mon Sep 17 00:00:00 2001 From: VinneyJ Date: Fri, 19 Jul 2024 12:07:47 +0300 Subject: [PATCH 4/4] fix: change app to api on urls --- doc/api_2_0_spec/admin_api_2_0_spec.md | 48 +++---- doc/api_2_0_spec/api_2_0_spec.md | 80 ++++++------ doc/api_2_0_spec/topics_api_2_0_spec.md | 164 ++++++++++++------------ 3 files changed, 146 insertions(+), 146 deletions(-) diff --git a/doc/api_2_0_spec/admin_api_2_0_spec.md b/doc/api_2_0_spec/admin_api_2_0_spec.md index 5918845418..200ebfb9ed 100644 --- a/doc/api_2_0_spec/admin_api_2_0_spec.md +++ b/doc/api_2_0_spec/admin_api_2_0_spec.md @@ -163,11 +163,11 @@ Media Cloud API 2.0 Spec for a more detailed description of the `q` and `fq` par The output of these calls is in exactly the same format as for the api/v2/stories/single call. -URL: https://app.civicsignal.africa/api/v2/stories/list?last_processed_stories_id=8625915 +URL: https://api.civicsignal.africa/api/v2/stories/list?last_processed_stories_id=8625915 Return a stream of all stories processed by Media Cloud, greater than the `last_processed_stories_id`. -URL: https://app.civicsignal.africa/api/v2/stories/list?last_processed_stories_id=2523432&q=text:obama+AND+media_id:1 +URL: https://api.civicsignal.africa/api/v2/stories/list?last_processed_stories_id=2523432&q=text:obama+AND+media_id:1 Return a stream of all stories from The New York Times mentioning `'obama'` greater than the given `last_processed_stories_id`. @@ -195,7 +195,7 @@ This call updates a single existing story. ### Example -URL: https://app.civicsignal.africa/api/v2/stories/update +URL: https://api.civicsignal.africa/api/v2/stories/update Input: @@ -229,7 +229,7 @@ Output: Fetch raw CLIFF annotation for stories 1, 2 and a nonexistent story 3: -URL: https://app.civicsignal.africa/api/v2/stories/cliff?stories_id=1&stories_id=2&stories_id=3 +URL: https://api.civicsignal.africa/api/v2/stories/cliff?stories_id=1&stories_id=2&stories_id=3 Response: @@ -281,7 +281,7 @@ Response: Fetch raw NYTLabels annotation for stories 1, 2 and a nonexistent story 3: -URL: https://app.civicsignal.africa/api/v2/stories/nytlabels?stories_id=1&stories_id=2&stories_id=3 +URL: https://api.civicsignal.africa/api/v2/stories/nytlabels?stories_id=1&stories_id=2&stories_id=3 Response: @@ -351,7 +351,7 @@ rows parameter. Fetch sentences containing the stem 'vaccin*' -URL: https://app.civicsignal.africa/api/v2/sentences/list?q=vaccin* +URL: https://api.civicsignal.africa/api/v2/sentences/list?q=vaccin* ```json [ @@ -452,7 +452,7 @@ for each tag_set included in the list of tags other than the tags added by this ### Example -URL: https://app.civicsignal.africa/api/v2/stories/put_tags +URL: https://api.civicsignal.africa/api/v2/stories/put_tags Input: @@ -497,7 +497,7 @@ Output: ### Example -https:///api/v2/tags/create +https://api.civicsignal.africa/api/v2/tags/create Input: @@ -541,7 +541,7 @@ See api/v2/tags/create above. The update call also requires a tags_id field ### Example -https://app.civicsignal.africa/api/v2/tags/update +https://api.civicsignal.africa/api/v2/tags/update Input: @@ -584,7 +584,7 @@ Output: ### Example -https://app.civicsignal.africa/api/v2/tag_sets/update/ +https://api.civicsignal.africa/api/v2/tag_sets/update/ Input: @@ -622,7 +622,7 @@ See tags/create above. The tag_sets/update call also requires a tag_sets_id fie ### Example -https://app.civicsignal.africa/api/v2/tag_sets/update +https://api.civicsignal.africa/api/v2/tag_sets/update Input: @@ -678,7 +678,7 @@ The `active = true` (the default) will cause the feed to be regularly crawled. Create a new feed in media_id 1: -URL: https://app.civicsignal.africa/api/v2/feeds/create +URL: https://api.civicsignal.africa/api/v2/feeds/create Input: @@ -720,7 +720,7 @@ See api/v2/feeds/create above. The input document can contain any subset of fie Update the `active` of feed 1 to `false`. -URL: https://app.civicsignal.africa/api/v2/feeds/update +URL: https://api.civicsignal.africa/api/v2/feeds/update Input: @@ -908,7 +908,7 @@ The output is always a list of records with the fields described above. The out ### Example -URL: https://app.civicsignal.africa/api/v2/media/create (PUT) +URL: https://api.civicsignal.africa/api/v2/media/create (PUT) Input: @@ -957,7 +957,7 @@ See api/v2/media/create end point above for possible input fields. The input re ### Example -URL: https://app.civicsignal.africa/api/v2/media/update +URL: https://api.civicsignal.africa/api/v2/media/update Input: @@ -991,17 +991,17 @@ Suggestions will be listed in the order that they were submitted. ### Example -URL: https://app.civicsignal.africa/api/v2/media/list_suggestions +URL: https://api.civicsignal.africa/api/v2/media/list_suggestions Output: ```json [ { - "email": "hroberts@app.civicsignal.africa", + "email": "hroberts@api.civicsignal.africa", "auth_users_id": 123, - "url": "http://app.civicsignal.africa", - "feed_url": "http://app.civicsignal.africa/feed/", + "url": "http://api.civicsignal.africa", + "feed_url": "http://api.civicsignal.africa/feed/", "reason": "Media Cloud is a great project", "tags_ids": [ 123, 456 ], "date_submitted": "2016-11-20 07:42:00", @@ -1036,7 +1036,7 @@ Note that marking a suggestion as approved does not automatically create the med ### Example -URL: https://app.civicsignal.africa/api/v2/media/mark_suggestion +URL: https://api.civicsignal.africa/api/v2/media/mark_suggestion Input: @@ -1088,7 +1088,7 @@ See `api/v2/users/list` below for sample output. ### Example -URL: https://app.civicsignal.africa/api/v2/users/list?search=foo +URL: https://api.civicsignal.africa/api/v2/users/list?search=foo Output: @@ -1171,7 +1171,7 @@ All of the input fields other than ### Example -URL: https://app.civicsignal.africa/api/v2/users/update +URL: https://api.civicsignal.africa/api/v2/users/update Input: @@ -1208,7 +1208,7 @@ This call deletes a single existing user. ### Example -URL: https://app.civicsignal.africa/api/v2/users/update +URL: https://api.civicsignal.africa/api/v2/users/update Input: @@ -1236,7 +1236,7 @@ none. ### Example -URL: https://app.civicsignal.africa/api/v2/users/list\_roles +URL: https://api.civicsignal.africa/api/v2/users/list\_roles Output: diff --git a/doc/api_2_0_spec/api_2_0_spec.md b/doc/api_2_0_spec/api_2_0_spec.md index 34768f7b47..a1b944828f 100644 --- a/doc/api_2_0_spec/api_2_0_spec.md +++ b/doc/api_2_0_spec/api_2_0_spec.md @@ -184,7 +184,7 @@ https://topics.civicsignal.africa/#/user/profile ### Example -https://app.civicsignal.africa/api/v2/media/single/1?key=KRN4T5JGJ2A +https://api.civicsignal.africa/api/v2/media/single/1?key=KRN4T5JGJ2A ## Python Client @@ -255,7 +255,7 @@ None. Fetching information on The New York Times -URL: https://app.civicsignal.africa/api/v2/media/single/1 +URL: https://api.civicsignal.africa/api/v2/media/single/1 Response: @@ -339,7 +339,7 @@ If the `q` parameter is specified, return only media that include at least on se All tags specified in the `tags\_id` parameter are OR'd together. Additonal lists of tags can be specified in numbered tags_id lists, eg. `tags\_id\_1`. Each set of numbered tag lists will be AND'd together. -URL: https://app.civicsignal.africa/api/v2/media/list?last_media_id=1&rows=2 +URL: https://api.civicsignal.africa/api/v2/media/list?last_media_id=1&rows=2 Output format is the same as for api/v2/media/single above. @@ -363,7 +363,7 @@ This API end point allows the user to send a suggest a new media source to the M ### Example -URL: https://app.civicsignal.africa/api/v2/media/submit_suggestion +URL: https://api.civicsignal.africa/api/v2/media/submit_suggestion Input: ```json @@ -432,7 +432,7 @@ volume. More details are in the field descriptions below Fetch media health information for media source 4438: -https://app.civicsignal.africa/api/v2/mediahealth/list?media_id=4438 +https://api.civicsignal.africa/api/v2/mediahealth/list?media_id=4438 Response: @@ -498,7 +498,7 @@ None. ### Example -URL: https://app.civicsignal.africa/api/v2/feeds/single/1 +URL: https://api.civicsignal.africa/api/v2/feeds/single/1 ```json [ @@ -528,7 +528,7 @@ URL: https://app.civicsignal.africa/api/v2/feeds/single/1 ### Example -URL: https://app.civicsignal.africa/api/v2/feeds/list?media_id=1 +URL: https://api.civicsignal.africa/api/v2/feeds/list?media_id=1 Output format is the same as for api/v2/feeds/single above. @@ -569,7 +569,7 @@ The following table describes the meaning and origin of fields returned by both Note: This fetches data on the CC licensed Global Voices story ["Myanmar's new flag and new name"](http://globalvoicesonline.org/2010/10/26/myanmars-new-flag-and-new-name/#comment-1733161) from November 2010. -URL: https://app.civicsignal.africa/api/v2/stories_public/single/27456565 +URL: https://api.civicsignal.africa/api/v2/stories_public/single/27456565 ```json @@ -644,11 +644,11 @@ an error. The output of these calls is in exactly the same format as for the api/v2/stories_public/single call. -URL: https://app.civicsignal.africa/api/v2/stories_public/list?last_processed_stories_id=8625915 +URL: https://api.civicsignal.africa/api/v2/stories_public/list?last_processed_stories_id=8625915 Return a stream of all stories processed by Media Cloud, greater than the `last_processed_stories_id`. -URL: https://app.civicsignal.africa/api/v2/stories_public/list?last_processed_stories_id=2523432&q=text:obama+AND+media_id:1 +URL: https://api.civicsignal.africa/api/v2/stories_public/list?last_processed_stories_id=2523432&q=text:obama+AND+media_id:1 Return a stream of all stories from The New York Times mentioning `'obama'` greater than the given `last_processed_stories_id`. @@ -674,7 +674,7 @@ If split is specified, split the counts into periods set by split_period. Count stories containing the word 'obama' in The New York Times. -URL: https://app.civicsignal.africa/api/v2/stories_public/count?q=obama&fq=media_id:1 +URL: https://api.civicsignal.africa/api/v2/stories_public/count?q=obama&fq=media_id:1 ```json { @@ -684,7 +684,7 @@ URL: https://app.civicsignal.africa/api/v2/stories_public/count?q=obama&fq=media Count stories containing 'africa' in the New York Times for each week from 2014-01-01 to 2014-03-01: -URL: https://app.civicsignal.africa/api/v2/stories_public/count?split=1&split_period=week&q=africa%20AND%20media_id%3A1%20AND%20publish_day%3A%5B2014-01-01T00%3A00%3A00Z%20TO%202014-03-01T00%3A00%3A00Z%5D +URL: https://api.civicsignal.africa/api/v2/stories_public/count?split=1&split_period=week&q=africa%20AND%20media_id%3A1%20AND%20publish_day%3A%5B2014-01-01T00%3A00%3A00Z%20TO%202014-03-01T00%3A00%3A00Z%5D ```json { @@ -749,7 +749,7 @@ s applied before the tag_sets_id parameter, so fewer than limit (or zero) result Count tags in stories containing the word 'obama' in The New York Times. -URL: https://app.civicsignal.africa/api/v2/stories_public/tag_count?q=obama&fq=media_id:1&limit=3 +URL: https://api.civicsignal.africa/api/v2/stories_public/tag_count?q=obama&fq=media_id:1&limit=3 ```json [ @@ -909,7 +909,7 @@ Setting the 'stats' field to true changes the structure of the response, as show Get word frequency counts for all sentences containing the word `'obama'` in The New York Times -URL: +URL: ```json [ @@ -949,7 +949,7 @@ URL: Get word frequency counts for all sentences containing the word `'obama'` in The New York Times, with stats data included -URL: +URL: ```json @@ -1040,7 +1040,7 @@ tag set. Fetching information on the tag 8876989. -URL: https://app.civicsignal.africa/api/v2/tags/single/8875027 +URL: https://api.civicsignal.africa/api/v2/tags/single/8875027 Response: @@ -1092,7 +1092,7 @@ returned. ### Example -URL: https://app.civicsignal.africa/api/v2/tags/list?rows=2&tag_sets_id=5&last_tags_id=8875026 +URL: https://api.civicsignal.africa/api/v2/tags/list?rows=2&tag_sets_id=5&last_tags_id=8875026 ## api/v2/tag_sets/single/ @@ -1124,7 +1124,7 @@ tag set. Fetching information on the tag set 5. -URL: https://app.civicsignal.africa/api/v2/tag_sets/single/5 +URL: https://api.civicsignal.africa/api/v2/tag_sets/single/5 Response: @@ -1158,7 +1158,7 @@ None. ### Example -URL: https://app.civicsignal.africa/api/v2/tag_sets/list +URL: https://api.civicsignal.africa/api/v2/tag_sets/list # Registration and Authentication @@ -1216,7 +1216,7 @@ After successful registraction, user is sent an email inviting him to open a lin #### Example -URL: +URL: Input: @@ -1280,7 +1280,7 @@ Output: #### Example -URL: +URL: Input: @@ -1342,7 +1342,7 @@ For the description of `activation_url`, see `auth/register`. #### Example -URL: +URL: Input: @@ -1409,7 +1409,7 @@ After successful send password reset API call, user is sent an email inviting hi #### Example -URL: +URL: Input: @@ -1467,7 +1467,7 @@ Output: #### Example -URL: +URL: Input: @@ -1532,7 +1532,7 @@ API call is rate-limited. #### Example -URL: +URL: Input: @@ -1614,7 +1614,7 @@ Media Cloud currently includes the following authentication roles: #### Example -URL: +URL: ```json { @@ -1686,7 +1686,7 @@ Asking user to re-enter password and comparing the two values is left to the cli #### Example -URL: +URL: Input: @@ -1739,7 +1739,7 @@ None. #### Example -URL: +URL: Output: @@ -1779,7 +1779,7 @@ Output: ### Example -URL: https://app.civicsignal.africa/api/v2/stats/list +URL: https://api.civicsignal.africa/api/v2/stats/list ```json { @@ -1814,7 +1814,7 @@ Detect whether a given block of content is likely to be ap syndicated content by ### Example -URL: https://app.civicsignal.africa/api/v2/util/is_syndicated_ap +URL: https://api.civicsignal.africa/api/v2/util/is_syndicated_ap Input: @@ -1846,7 +1846,7 @@ import pkg_resources import requests assert pkg_resources.get_distribution("requests").version >= '1.2.3' -r = requests.get('https://app.civicsignal.africa/api/v2/media/list', +r = requests.get('https://api.civicsignal.africa/api/v2/media/list', params = params, headers = { 'Accept': 'application/json'}, headers = { 'Accept': 'application/json'} @@ -1864,7 +1864,7 @@ rows = 1000 while True: params = { 'last_media_id': last_media_id, 'rows': rows, 'key': MY_KEY } print "last_media_id:{} rows:{}".format( last_media_id, rows) - r = requests.get( 'https://app.civicsignal.africa/api/v2/media/list', params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://api.civicsignal.africa/api/v2/media/list', params = params, headers = { 'Accept': 'application/json'} ) data = r.json() if len(data) == 0: @@ -1914,7 +1914,7 @@ while True: params = { 'last_processed_stories_id': start, 'rows': rows, 'q': 'tags_id_media:8875027', 'key': MY_KEY } print "Fetching {} stories starting from {}".format( rows, start) - r = requests.get( 'https://app.civicsignal.africa/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://api.civicsignal.africa/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) stories = r.json() if len(stories) == 0: @@ -1955,7 +1955,7 @@ while True: } print "Fetching {} stories starting from {}".format( rows, start) - r = requests.get( 'https://app.civicsignal.africa/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://api.civicsignal.africa/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) stories = r.json() if len(stories) == 0: @@ -1979,13 +1979,13 @@ One way to appropriately restrict the data is by setting the `q` parameter to re Below `q` is set to `"text:trayvon"` and `fq` is set to `"tags_iud_media:8875027" and "publish_date:[2012-04-01T00:00:00.000Z TO 2013-05-01T00:00:00.000Z]"`. (Note that ":", "[", and "]" are URL encoded.) ```bash -curl 'https://app.civicsignal.africa/api/v2/wc?q=text:trayvon&fq=tags_iud_media:8875027&fq=publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D' +curl 'https://api.civicsignal.africa/api/v2/wc?q=text:trayvon&fq=tags_iud_media:8875027&fq=publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D' ``` Alternatively, we could use a single large query by setting `q` to `"text:trayvon AND tags_id_media:8875027 AND publish_date:[2012-04-01T00:00:00.000Z TO 2013-05-01T00:00:00.000Z]"`: ```bash -curl 'https://app.civicsignal.africa/api/v2/wc?q=text:trayvon+AND+tags_id_media:8875027+AND+publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D&fq=tags_id_media:8875027&fq=publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D' +curl 'https://api.civicsignal.africa/api/v2/wc?q=text:trayvon+AND+tags_id_media:8875027+AND+publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D&fq=tags_id_media:8875027&fq=publish_date:%5B2012-04-01T00:00:00.000Z+TO+2013-05-01T00:00:00.000Z%5D' ``` @@ -1997,7 +1997,7 @@ curl 'https://app.civicsignal.africa/api/v2/wc?q=text:trayvon+AND+tags_id_media: The user requests a list of all tag sets. ```bash -curl https://app.civicsignal.africa/api/v2/tag_sets/list +curl https://api.civicsignal.africa/api/v2/tag_sets/list ``` ```json @@ -2029,7 +2029,7 @@ def find_tags_id( tag_name, tag_sets_id): while True: params = { 'last_tags_id': last_tags_id, 'rows': rows, 'key': MY_KEY } print "start:{} rows:{}".format( start, rows) - r = requests.get( 'https://app.civicsignal.africa/api/v2/tags/list/' + tag_sets_id , params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://api.civicsignal.africa/api/v2/tags/list/' + tag_sets_id , params = params, headers = { 'Accept': 'application/json'} ) tags = r.json() if len(tags) == 0: @@ -2050,7 +2050,7 @@ Assume that the user determined that the `tags_id` was 12345678 using the above the word count for all sentences in stories belonging to any media source associated with tag 12345678. ```bash -curl 'https://app.civicsignal.africa/api/v2/wc?q=tags_id_media:12345678' +curl 'https://api.civicsignal.africa/api/v2/wc?q=tags_id_media:12345678' ``` ## Grab stories from 10 January 2014 with the tag `'foo:bar'` @@ -2076,7 +2076,7 @@ while True: params = { 'last_processed_stories_id': start, 'rows': rows, 'q': 'tags_id_stories:678910', 'key': MY_KEY } print "Fetching {} stories starting from {}".format( rows, start) - r = requests.get( 'https://app.civicsignal.africa/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) + r = requests.get( 'https://api.civicsignal.africa/api/v2/stories_public/list/', params = params, headers = { 'Accept': 'application/json'} ) stories = r.json() if len(stories) == 0: diff --git a/doc/api_2_0_spec/topics_api_2_0_spec.md b/doc/api_2_0_spec/topics_api_2_0_spec.md index c3300801a5..c324537d76 100644 --- a/doc/api_2_0_spec/topics_api_2_0_spec.md +++ b/doc/api_2_0_spec/topics_api_2_0_spec.md @@ -218,11 +218,11 @@ data. All URLs in the topics API are in the form: -`https://app.civicsignal.africa/api/v2/topics//stories/list` +`https://api.civicsignal.africa/api/v2/topics//stories/list` For example, the following will return all stories in the latest snapshot of topic id 1344. -`https://app.civicsignal.africa/api/v2/topics/1344/stories/list` +`https://api.civicsignal.africa/api/v2/topics/1344/stories/list` ## Snapshots, Timespans, and Foci @@ -298,7 +298,7 @@ For example, the following is a paged response: After receiving that response, you can use the following URL with no other parameters to fetch the next page of results: -`https://app.civicsignal.africa/api/v2/topics/1/stories/list?link_id=789123` +`https://api.civicsignal.africa/api/v2/topics/1/stories/list?link_id=789123` When the system has reached the end of the results, it will return an empty list and a nullĀ 'next' *link_id*. @@ -329,7 +329,7 @@ represents the set of stories active in a topic within a given date range. Ever ## `topics/create` (POST) -`https://app.civicsignal.africa/api/v2/topics/create` +`https://api.civicsignal.africa/api/v2/topics/create` Create and return a new *topic*. @@ -345,7 +345,7 @@ The topics/create call accepts as input the following fields described in the Ou Create a new topic: -`https://app.civicsignal.africa/api/v2/topics/create` +`https://api.civicsignal.africa/api/v2/topics/create` Input: @@ -401,7 +401,7 @@ Response: ## `topics//update` (PUT) -`https://app.civicsignal.africa/api/v2/topics//update` +`https://api.civicsignal.africa/api/v2/topics//update` Edit an existing *topic*. @@ -425,7 +425,7 @@ Accepts the same input as the topics/create call. Edit the 'immigration 2015' topic. -`https://app.civicsignal.africa/api/v2/topics/1390/update` +`https://api.civicsignal.africa/api/v2/topics/1390/update` Input: @@ -468,7 +468,7 @@ Response: ``` ## `topics/info` (GET) -`https://app.civicsignal.africa/api/v2/topics/info +`https://api.civicsignal.africa/api/v2/topics/info Get a list of modes, sources, and platforms supported by media cloud. @@ -478,7 +478,7 @@ Get a list of modes, sources, and platforms supported by media cloud. ### Example -`https://app.civicsignal.africa/api/v2/topics/info` +`https://api.civicsignal.africa/api/v2/topics/info` Nore that the below response is only an example. The data returned by this call will change over time. @@ -584,7 +584,7 @@ Response: ## `topics//add_seed_query` (PUT) -`https://app.civicsignal.africa/api/v2/topics//add_seed_query` +`https://api.civicsignal.africa/api/v2/topics//add_seed_query` Add a seed query to an existing topic. If the same seed querty already exists, do nothing. Returns the created or found seed query. @@ -608,7 +608,7 @@ To get the list of allowed sources and platforms, see the topics/info end point. Add a crimson hexagon twitter search: -`https://app.civicsignal.africa/api/v2/topics/1390/add_seed_query` +`https://api.civicsignal.africa/api/v2/topics/1390/add_seed_query` Input: @@ -638,7 +638,7 @@ Response: ## `topics//remove_seed_query` (PUT) -`https://app.civicsignal.africa/api/v2/topics//remove_seed_query` +`https://api.civicsignal.africa/api/v2/topics//remove_seed_query` Remove an existing topic seed query. @@ -655,7 +655,7 @@ Remove an existing topic seed query. Remove a seed query: -`https://app.civicsignal.africa/api/v2/topics/1390/remove_seed_query` +`https://api.civicsignal.africa/api/v2/topics/1390/remove_seed_query` Input: @@ -673,7 +673,7 @@ Response: ## topics//reset (PUT) -`https://app.civicsignal.africa/api/v2/topics/~topics_id~/reset` +`https://api.civicsignal.africa/api/v2/topics/~topics_id~/reset` Delete all existing stories, links, and seed urls from an existing *topic*. Set the topic state to 'created but not queued' and the message to null. @@ -696,7 +696,7 @@ This call will return an error if it is run on a *topic* with a state of 'runnin Reset the 'immigration 2015' topic. -`https://app.civicsignal.africa/api/v2/topics/1390/reset` +`https://api.civicsignal.africa/api/v2/topics/1390/reset` Response: @@ -708,7 +708,7 @@ Response: ## `topics//spider` (POST) -`https://app.civicsignal.africa/api/v2/topics//spider` +`https://api.civicsignal.africa/api/v2/topics//spider` Start a topic spidering job. @@ -733,7 +733,7 @@ The call returns a `job_state` record with information about the state of the qu Start a topic spider for the 'U.S. 2016 Election' topic: -`https://app.civicsignal.africa/api/v2/topics/1404/spider` +`https://api.civicsignal.africa/api/v2/topics/1404/spider` Input: @@ -762,7 +762,7 @@ Response: ## `topics//spider_status` -`https://app.civicsignal.africa/api/v2/topics//spider_status` +`https://api.civicsignal.africa/api/v2/topics//spider_status` Get a list all spidering jobs started for this topic. @@ -784,7 +784,7 @@ Get a list all spidering jobs started for this topic. ### Example -`https://app.civicsignal.africa/api/v2/topics/1404/spider_status` +`https://api.civicsignal.africa/api/v2/topics/1404/spider_status` Response: @@ -805,7 +805,7 @@ Response: ## `topics/list` -`https://app.civicsignal.africa/api/v2/topics/list` +`https://api.civicsignal.africa/api/v2/topics/list` The topics/list call returns a simple list of topics available in Media Cloud. The call will only return topics for which the calling user has read or higher permissions. @@ -850,7 +850,7 @@ Standard parameters accepted: link_id. Fetch all topics in Media Cloud: -`https://app.civicsignal.africa/api/v2/topics/list` +`https://api.civicsignal.africa/api/v2/topics/list` Response: @@ -922,7 +922,7 @@ Response: ## `topics/single/` -`https://app.civicsignal.africa/api/v2/topics/single/` +`https://api.civicsignal.africa/api/v2/topics/single/` The topics/single call returns a single topic, if the calling user has permission to read that topic. @@ -938,7 +938,7 @@ The topics/single call returns a single topic, if the calling user has permissio Fetch a single topic: -`https://app.civicsignal.africa/api/v2/topics/single/672` +`https://api.civicsignal.africa/api/v2/topics/single/672` Response: @@ -978,7 +978,7 @@ Response: ## `topics//list_timespan_files` -`https://app.civicsignal.africa/api/v2/topics//list_timespan_files` +`https://api.civicsignal.africa/api/v2/topics//list_timespan_files` List all timespan\_files associated with the given timespan. Timespan files are dumps made by the spider during the snapshotting process. @@ -997,7 +997,7 @@ during the snapshotting process. ### Example -`https://app.civicsignal.africa/api/v2/topics/123/list_timespan_files` +`https://api.civicsignal.africa/api/v2/topics/123/list_timespan_files` Response: @@ -1015,7 +1015,7 @@ Response: ## `topics//list_snapshot_files` -`https://app.civicsignal.africa/api/v2/topics//list_snapshot_files` +`https://api.civicsignal.africa/api/v2/topics//list_snapshot_files` List all snapshot\_files associated with the given snapshot. Snapshot files are dumps made by the spider during the snapshotting process. Snapshot files are only accessible by users with admin access. @@ -1034,7 +1034,7 @@ during the snapshotting process. Snapshot files are only accessible by users wit ### Example -`https://app.civicsignal.africa/api/v2/topics/123/list_snapshot_files` +`https://api.civicsignal.africa/api/v2/topics/123/list_snapshot_files` Response: @@ -1056,7 +1056,7 @@ Response: ## `topics/permissions/user/list` -`https://app.civicsignal.africa/api/v2/topics/permissions/user/list` +`https://api.civicsignal.africa/api/v2/topics/permissions/user/list` List all permissions assigned to the authenticated user for all topics. This list includes only permissions granted specifically to this user. Topics available for reading through the 'public' flag are not included in this list. @@ -1076,7 +1076,7 @@ List all permissions assigned to the authenticated user for all topics. This li List all permissions belonging to the authenticated user: -`https://app.civicsignal.africa/api/v2/topics/permissions/user/list` +`https://api.civicsignal.africa/api/v2/topics/permissions/user/list` Response: @@ -1095,7 +1095,7 @@ Response: ## `topics//permissions/list` -`https://app.civicsignal.africa/api/v2/topics//permissions/list` +`https://api.civicsignal.africa/api/v2/topics//permissions/list` List all permissions for the given topic. @@ -1111,7 +1111,7 @@ List all permissions for the given topic. List all permissions belonging to the given topic: -`https://app.civicsignal.africa/api/v2/topics/1394/permissions/list` +`https://api.civicsignal.africa/api/v2/topics/1394/permissions/list` Response: @@ -1136,7 +1136,7 @@ Response: ## `topics//permissions/update` (PUT) -`https://app.civicsignal.africa/api/v2/topics//permissions/update` +`https://api.civicsignal.africa/api/v2/topics//permissions/update` Update permissions for a given user to a given topic. @@ -1161,7 +1161,7 @@ On success, the new permission is returned in the same format as the permissions Update the permissions for a given user for a given topic: -`https://app.civicsignal.africa/api/v2/topics//permissions/update` +`https://api.civicsignal.africa/api/v2/topics//permissions/update` Input: @@ -1195,7 +1195,7 @@ Response: ## `stories/list` -`https://app.civicsignal.africa/api/v2/topics//stories/list` +`https://api.civicsignal.africa/api/v2/topics//stories/list` The stories list call returns stories in the topic. @@ -1246,7 +1246,7 @@ Standard parameters accepted: snapshots_id, foci_id, timespans_id, limit, link_i Fetch all stories in topic id 1344: -`https://app.civicsignal.africa/api/v2/topics/1344/stories/list` +`https://api.civicsignal.africa/api/v2/topics/1344/stories/list` Response: @@ -1287,7 +1287,7 @@ Response: ## `stories/links` -`https://app.civicsignal.africa/api/v2/topics//stories/links` +`https://api.civicsignal.africa/api/v2/topics//stories/links` Return all links between individual stories across media within the given topic. @@ -1306,7 +1306,7 @@ Standard parameters accepted : snapshots_id, foci_id, timespans_id, limit. Return links for topic 1404: -`https://app.civicsignal.africa/api/v2/topics/1404/stories/links?limit=3` +`https://api.civicsignal.africa/api/v2/topics/1404/stories/links?limit=3` Response: @@ -1335,7 +1335,7 @@ Response: ## `stories/facebook` -`https://app.civicsignal.africa/api/v2/topics//stories/facebook` +`https://api.civicsignal.africa/api/v2/topics//stories/facebook` Return the current facebook counts for all stories in the topic. Note that this call returns the current facebook count data, which may change over time, rather than the snapshotted, static data returned by the @@ -1358,7 +1358,7 @@ Standard parameters accepted : snapshots_id, foci_id, timespans_id, limit. Return the facebook counts for 3 stories in the given topic. -`https://app.civicsignal.africa/api/v2/topics/1404/stories/facebook?limit=3` +`https://api.civicsignal.africa/api/v2/topics/1404/stories/facebook?limit=3` Response: @@ -1393,7 +1393,7 @@ Response: ## `stories/count` -`https://app.civicsignal.africa/api/v2/topics//stories/count` +`https://api.civicsignal.africa/api/v2/topics//stories/count` Return the number of stories that match the query. @@ -1417,7 +1417,7 @@ Standard parameters accepted : snapshots_id, foci_id, timespans_id, limit. Return the number of stories that mention 'immigration' in the 'US Election' topic: -`https://app.civicsignal.africa/api/v2/topics//stories/count?q=immigration` +`https://api.civicsignal.africa/api/v2/topics//stories/count?q=immigration` Response: @@ -1430,7 +1430,7 @@ Response: ## `sentences/count` -`https://app.civicsignal.africa/api/v2/topics//sentences/count` +`https://api.civicsignal.africa/api/v2/topics//sentences/count` Return the numer of sentences that match the query, optionally split by date. @@ -1445,7 +1445,7 @@ For details about this end point, including parameters, output, and examples, se ## `media/list` -`https://app.civicsignal.africa/api/v2/topics//media/list` +`https://api.civicsignal.africa/api/v2/topics//media/list` The media list call returns the list of media in the topic. @@ -1488,7 +1488,7 @@ Standard parameters accepted: snapshots_id, foci_id, timespans_id, limit, link_i Return all stories in the medium that match 'twitt': -`https://app.civicsignal.africa/api/v2/topics//media/list?name=twitt` +`https://api.civicsignal.africa/api/v2/topics//media/list?name=twitt` Response: @@ -1531,7 +1531,7 @@ Response: ## `media/links` -`https://app.civicsignal.africa/api/v2/topics//media/links` +`https://api.civicsignal.africa/api/v2/topics//media/links` Return all links between individual media within the given topic. @@ -1550,7 +1550,7 @@ Standard parameters accepted : snapshots_id, foci_id, timespans_id, limit. Return links for topic 1404: -`https://app.civicsignal.africa/api/v2/topics/1404/media/links?limit=3` +`https://api.civicsignal.africa/api/v2/topics/1404/media/links?limit=3` Response: @@ -1579,7 +1579,7 @@ Response: ## `media/map` -`https://app.civicsignal.africa/api/v2/topics//media/map` +`https://api.civicsignal.africa/api/v2/topics//media/map` The media list call returns a gexf formatted network map of the media in the topic / timespan. @@ -1609,12 +1609,12 @@ https://gephi.org/gexf/format/ Return the network map for topic id 12: -`https://app.civicsignal.africa/api/v2/topics/12/media/map` +`https://api.civicsignal.africa/api/v2/topics/12/media/map` ## `media/list_maps` -`https://app.civicsignal.africa/api/v2/topics//media/list_maps` +`https://api.civicsignal.africa/api/v2/topics//media/list_maps` Return a list of maps available within the timespan. @@ -1626,14 +1626,14 @@ None. Return the network map for topic id 12: -`https://app.civicsignal.africa/api/v2/topics/12/media/list_maps` +`https://api.civicsignal.africa/api/v2/topics/12/media/list_maps` # Word Counts ## `wc/list` -`https://app.civicsignal.africa/api/v2/topics//wc/list` +`https://api.civicsignal.africa/api/v2/topics//wc/list` Returns sampled counts of the most prevalent words in a topic, optionally restricted to sentences that match a given query. @@ -1672,7 +1672,7 @@ The Boolean Query focal technique associates a focus with a story by matching th ## `focal_set_definitions/create` (POST) -`https://app.civicsignal.africa/api/topics//focal_set_definitions/create` +`https://api.civicsignal.africa/api/topics//focal_set_definitions/create` Create and return a new *focal set definiition* within the given *topic*. @@ -1692,7 +1692,7 @@ Create and return a new *focal set definiition* within the given *topic*. Create a 'Candidates' focal set definition in the 'U.S. 2016 Election' topic: -`https://app.civicsignal.africa/api/v2/topics/1344/focal_set_definitions/create` +`https://api.civicsignal.africa/api/v2/topics/1344/focal_set_definitions/create` Input: @@ -1723,7 +1723,7 @@ Response: ## `focal_set_definitions//update` (PUT) -`https://app.civicsignal.africa/api/v2/topics//focal_set_definitions//update/` +`https://api.civicsignal.africa/api/v2/topics//focal_set_definitions//update/` Update the given focal set definition. @@ -1739,7 +1739,7 @@ See *focal_set_definitions/create* for a list of fields. Only fields that are i Update the name and description of the 'Candidates' focal set"definition": -`https://app.civicsignal.africa/api/v2/topics/1344/focal_set_definitions/789/update` +`https://api.civicsignal.africa/api/v2/topics/1344/focal_set_definitions/789/update` Input: @@ -1770,7 +1770,7 @@ Response: ## `focal_set_definitions//delete` (PUT) -`https://app.civicsignal.africa/api/v2/topics//focal_set_definitions//delete` +`https://api.civicsignal.africa/api/v2/topics//focal_set_definitions//delete` Delete a focal set definition. @@ -1788,7 +1788,7 @@ Delete a focal set definition. Delete focal_set_definitions_id 123: -`https://app.civicsignal.africa/api/v2/topics//focal_set_definitions/123/delete` +`https://api.civicsignal.africa/api/v2/topics//focal_set_definitions/123/delete` Response: @@ -1798,7 +1798,7 @@ Response: ## `focal_set_definitions/list` -`https://app.civicsignal.africa/api/v2/topics//focal_set_definitions/list` +`https://api.civicsignal.africa/api/v2/topics//focal_set_definitions/list` Return a list of all focal set definitions belonging to the given topic. @@ -1821,7 +1821,7 @@ Return a list of all focal set definitions belonging to the given topic. List all focal set definitions associated with the 'U.S. 2016 Elections'"topic": -`https://app.civicsignal.africa/api/v2/topics/1344/focal_set_definitions/list` +`https://api.civicsignal.africa/api/v2/topics/1344/focal_set_definitions/list` Response: @@ -1853,7 +1853,7 @@ Response: ## `focal_sets/list` -`https://app.civicsignal.africa/api/v2/topics//focal_sets/list` +`https://api.civicsignal.africa/api/v2/topics//focal_sets/list` List all *focal sets* belonging to the specified *snapshot* in the given *topic*. @@ -1878,7 +1878,7 @@ If no snapshots_id is specified, the latest snapshot will be used. If foci_id o Get a list of *focal sets* in the latest *snapshot* in the 'U.S. 2016 Election' *topic*: -`https://app.civicsignal.africa/api/v2/topics/1344/focal_sets_list` +`https://api.civicsignal.africa/api/v2/topics/1344/focal_sets_list` Response: @@ -1910,7 +1910,7 @@ Response: ## `focus_definitions/create` (POST) -`https://app.civicsignal.africa/api/topics//focus_definitions/create` +`https://api.civicsignal.africa/api/topics//focus_definitions/create` Create and return a new *focus definition* within the given *topic* and *focal set definition*. @@ -1933,7 +1933,7 @@ The input for the *focus definition* depends on the focal technique of the paren Create the 'Clinton' *focus definition* within the 'Candidates' *focal set definition* and the 'U.S. 2016 Election' *topic*: -`https://app.civicsignal.africa/api/v2/topics/1344/focus_definitions/create` +`https://api.civicsignal.africa/api/v2/topics/1344/focus_definitions/create` Input: @@ -1966,7 +1966,7 @@ Response: ## `focus_definitions//update` (PUT) -`https://app.civicsignal.africa/api/v2/topics//focus_definitions//update` +`https://api.civicsignal.africa/api/v2/topics//focus_definitions//update` Update the given focus definition. @@ -1982,7 +1982,7 @@ See *focus_definitions/create* for a list of fields. Only fields that are inclu Update the query for the 'Clinton' focus definition: -`https://app.civicsignal.africa/api/v2/topics/1344/focus_definitions/234/update` +`https://api.civicsignal.africa/api/v2/topics/1344/focus_definitions/234/update` Input: @@ -2008,7 +2008,7 @@ Response: ## `focus_definitions//delete` (PUT) -`https://app.civicsignal.africa/api/v2/topics//focus_definitions//delete` +`https://api.civicsignal.africa/api/v2/topics//focus_definitions//delete` Delete a focus definition. @@ -2026,7 +2026,7 @@ Delete a focus definition. Delete focus_definitions_id 123: -`https://app.civicsignal.africa/api/v2/topics//focus_definitions/123/delete` +`https://api.civicsignal.africa/api/v2/topics//focus_definitions/123/delete` Response: @@ -2036,7 +2036,7 @@ Response: ## `focus_definitions/list` -`https://app.civicsignal.africa/api/v2/topics//focus_definitions//list` +`https://api.civicsignal.africa/api/v2/topics//focus_definitions//list` List all *focus definitions* belonging to the given *focal set definition*. @@ -2062,7 +2062,7 @@ method specific fields are listed last in the table above and are prefixed with List all *focus definitions* belonging to the 'Candidates' *focal set definition* of the 'U.S. 2016 Election' *topic*: -`https://app.civicsignal.africa/api/v2/topics/1344/focus_definitions/234/list` +`https://api.civicsignal.africa/api/v2/topics/1344/focus_definitions/234/list` Response: @@ -2082,7 +2082,7 @@ Response: ## `foci/list` -`https://app.civicsignal.africa/api/v2/topics//foci/list` +`https://api.civicsignal.africa/api/v2/topics//foci/list` Return a list of the *foci* belonging to the given *focal set*. @@ -2107,7 +2107,7 @@ The output for *focus* depends on the focal technique of the parent *focus defin Get a list of *foci* wihin the 'Candiates' *focal set* of the 'U.S. 2016 Election' *topic*: -`https://app.civicsignal.africa/api/v2/topics/1344/foci/list?focal_sets_id=234` +`https://api.civicsignal.africa/api/v2/topics/1344/foci/list?focal_sets_id=234` Response: @@ -2131,7 +2131,7 @@ Each *snapshot* contains a static copy of all data within a topic at the time th ## `snapshots/create` (POST) -`https://app.civicsignal.africa/api/v2/topics//snapshots/create` +`https://api.civicsignal.africa/api/v2/topics//snapshots/create` Create a new but empty snapshot for the topic. This call only creates an empty shell of a snapshot. To fill it with data, you must pass the returned snapshots\_id to snapshots/generate or topic/spider. @@ -2154,7 +2154,7 @@ Returns the created snapshot, as in the example below. Create a new snapshot for the 'U.S. 2016 Election' *topic*: -`https://app.civicsignal.africa/api/v2/topics/1344/snapshots/create` +`https://api.civicsignal.africa/api/v2/topics/1344/snapshots/create` Response: @@ -2170,7 +2170,7 @@ Response: ## `snapshots/generate` (POST) -`https://app.civicsignal.africa/api/v2/topics//snapshots/generate` +`https://api.civicsignal.africa/api/v2/topics//snapshots/generate` Generate a new *snapshot* for the given topic. Note that `topics/spider` will generate a snapshot as part of its spidering process, so this end point only needs to be called to generate an additional snapshot of a topic @@ -2199,7 +2199,7 @@ This command will return a job_state object as described in the `snapshots/gener Start a new *snapshot* generation job for the 'U.S. 2016 Election' *topic*: -`https://app.civicsignal.africa/api/v2/topics/1344/snapshots/generate` +`https://api.civicsignal.africa/api/v2/topics/1344/snapshots/generate` Response: @@ -2218,7 +2218,7 @@ Response: ## `snapshots/generate_status` -`https://app.civicsignal.africa/api/v2/topics//snapshots/generate_status` +`https://api.civicsignal.africa/api/v2/topics//snapshots/generate_status` Return a list of snapshots job_states for the given snapshot; @@ -2245,7 +2245,7 @@ Return a list of snapshots job_states for the given snapshot; List snapshot jobs for the 'U.S. 2016 Election' *topic*: -`https://app.civicsignal.africa/api/v2/topics/1344/snapshots/generate_status` +`https://api.civicsignal.africa/api/v2/topics/1344/snapshots/generate_status` Response: @@ -2265,7 +2265,7 @@ Response: ## `snapshots/list` -`https://app.civicsignal.africa/api/v2/topics//snapshots/list` +`https://api.civicsignal.africa/api/v2/topics//snapshots/list` Return a list of all completed *snapshots* in the given *topic*. @@ -2296,7 +2296,7 @@ few minutes up to a few hours. The 'searchable' field is set to true once that Return a list of *snapshots* in the 'U.S. 2016 Election' *topic*: -`https://app.civicsignal.africa/api/v2/topics/1344/snapshots/list` +`https://api.civicsignal.africa/api/v2/topics/1344/snapshots/list` Response: @@ -2418,7 +2418,7 @@ word_vectors = gensim.models.KeyedVectors.load_word2vec_format('model.bin', bina ### Example -URL: +URL: Output: `application/octet-stream` model data of topic with `topics_id=6`, snapshot with `snapshots_id=1`, word2vec model with `models_id=1`. @@ -2431,7 +2431,7 @@ A *story* is included within a *timespan* if the publish_date of the story is wi ## `timespans/list` -`https://app.civicsignal.africa/api/v2/topics//timespans/list` +`https://api.civicsignal.africa/api/v2/topics//timespans/list` Return a list of timespans in the current snapshot. @@ -2470,7 +2470,7 @@ Media Cloud needs to guess the date of many of the stories discovered while topi Return all *timespans* associated with the latest *snapshot* of the 'U.S. 2016 Election' *topic*: -`https://app.civicsignal.africa/api/v2/topics/1344/timespans/list` +`https://api.civicsignal.africa/api/v2/topics/1344/timespans/list` Response: