### Copy Database Configuration Example Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Copies the example database configuration file to the main configuration file for manual setup. ```bash cp config/database.yml.example config/database.yml ``` -------------------------------- ### Start Rails Server (Manual Setup) Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Starts the Rails development server for manual setup. ```bash rails s ``` -------------------------------- ### Start Services with Docker Compose Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Starts all the services defined in the docker-compose.yml file. ```bash docker-compose up ``` -------------------------------- ### Database Setup and CMS Initialization Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Sets up the database and initializes the Lumen CMS. ```bash rails db:setup ``` ```bash rails lumen:set_up_cms ``` -------------------------------- ### Setup for Parallel Tests Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Configures the test database and runs setup for parallel test execution. ```bash rake parallel:setup ``` -------------------------------- ### Install Ruby Gems Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Installs all the necessary Ruby gems for the project. ```bash bundle install ``` -------------------------------- ### Start Rails Server Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Starts the Rails development server, binding to all network interfaces. ```bash rails s -b 0.0.0.0 ``` -------------------------------- ### Database Migrations and Seeding Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Performs database setup including dropping, creating, migrating, and seeding the database. ```bash rake db:drop db:create db:migrate ``` ```bash rake comfy:cms_seeds:import[lumen_cms,lumen_cms] ``` ```bash rake db:seed ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://berkman-klein-center.gitbook.io/lumen-database/development Use this method to dynamically query the documentation by performing an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://berkman-klein-center.gitbook.io/lumen-database/development.md?ask= ``` -------------------------------- ### Start Sidekiq Background Worker Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Starts the Sidekiq background job processor. ```bash bundle exec sidekiq & ``` -------------------------------- ### Successful Response Example Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation A successful response indicates resource creation with an HTTP 201 status and a Location header. ```HTTP HTTP/1.1 201 Created Location: http://localhost:3000/notices/4 Content-Type: application/json; charset=utf-8 Cache-Control: max-age=0, private, must-revalidate Date: Wed, 05 Jun 2013 20:43:34 GMT Content-Length: 1 ``` -------------------------------- ### Run Logstash for Search Indexing Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Starts the Logstash binary to index data from PostgreSQL to Elasticsearch using a specified configuration file. ```bash bin/logstash -f logstash.conf ``` -------------------------------- ### Query Documentation Dynamically Source: https://berkman-klein-center.gitbook.io/lumen-database/api Perform an HTTP GET request to query the documentation. Use the 'ask' query parameter with a specific, self-contained question in natural language. ```http GET https://berkman-klein-center.gitbook.io/lumen-database/api.md?ask= ``` -------------------------------- ### Query Documentation with GET Request Source: https://berkman-klein-center.gitbook.io/lumen-database/other/license Use this method to ask questions to the documentation system when the answer is not explicitly present on the current page. The question should be specific and self-contained. ```http GET https://berkman-klein-center.gitbook.io/lumen-database/other/license.md?ask= ``` -------------------------------- ### Request a Notice by ID Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Retrieve a specific notice by its ID using a GET request. A custom User-Agent is required, as default user agents are blocked. ```bash curl -H "User-Agent: SomeUserAgentHere" https://lumendatabase.org/notices/1.json ``` -------------------------------- ### Search Entities Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Example of how to search for entities using the Lumen API. This includes the cURL command and a sample successful JSON response. ```bash curl -H "User-Agent: SomeUserAgentHere" -H "Accept: application/json" -H "Content-type: application/json" 'https://lumendatabase.org/entities/search?term=joe&page=1' ``` -------------------------------- ### Get a Specific Notice with URL Parameter Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Retrieve a specific notice using its ID and including the authentication token as a URL parameter. A custom User-Agent is required. ```bash curl -kv -H "User-Agent: SomeUserAgentHere" https://lumendatabase.org/notices/1.json?authentication_token=abc123 ``` -------------------------------- ### Get a Specific Notice with HTTP Header Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Retrieve a specific notice using its ID and including the authentication token in the X-Authentication-Token HTTP header. A custom User-Agent is required. ```bash curl -kv -H "User-Agent: SomeUserAgentHere" -H "X-Authentication-Token: abc123" https://lumendatabase.org/notices/1.json ``` -------------------------------- ### Unsuccessful Response Example (Validation Failures) Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Unsuccessful responses often return HTTP 422 with a JSON body detailing validation errors for specific fields. ```JSON { "works":["can't be blank"], "entity_notice_roles":["can't be blank"], "title":["can't be blank"] } ``` -------------------------------- ### Example Successful Response for Topics Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation This JSON structure represents a successful response when requesting a list of topics. It includes the ID, name, and parent ID for each topic. ```json { "topics": [ { "id": 1, "name": "Lumen", "parent_id": null }, { "id": 2, "name": "Copyright", "parent_id": null }, { "id": 3, "name": "Anticircumvention (DMCA)", "parent_id": 2 } ] } ``` -------------------------------- ### View Application in Browser Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Opens the application in the default web browser. ```bash $BROWSER 'http://localhost:3000' ``` -------------------------------- ### Get a Specific Notice Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Retrieves a specific notice from the Lumen Database by its ID. A custom User-Agent is required for this request. ```APIDOC ## GET /notices/{notice_id}.json ### Description Retrieves a specific notice from the Lumen Database by its ID. ### Method GET ### Endpoint https://lumendatabase.org/notices/.json ### Parameters #### Query Parameters - **authentication_token** (string) - Required - Your authentication token for accessing the API. #### Request Headers - **User-Agent** (string) - Required - A custom user agent string. Default user agents are blocked. - **X-Authentication-Token** (string) - Required - Your authentication token for accessing the API. ### Request Example ```http GET https://lumendatabase.org/notices/1.json?authentication_token=abc123 ``` ### Response #### Success Response (200) Returns a JSON-encoded representation of the notice attributes. Notice types will have mapped attributes applied and be under a root key articulating their type. ``` -------------------------------- ### Run Tests with Docker Compose Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Sets up and runs all services using a specific Docker Compose file for testing, then executes tests within the website container. ```bash $ docker-compose -f docker-compose.test.yml --env-file .env.test up ``` ```bash $ docker-compose exec -e RAILS_ENV=test website bash -c "bundle install && rake db:drop db:create db:migrate && rspec" ``` -------------------------------- ### Submit Notice Data with URL Parameter Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Submit new notice data using a POST request, including the authentication token as a URL parameter and the notice data in JSON format. Specify Content-type and Accept headers. ```bash curl -H "User-Agent: SomeUserAgentHere" \ -H "Accept: application/json" \ -H "Content-type: application/json" \ -d '{ "notice": {...} }' \ 'https://lumendatabase.org/notices?authentication_token=abc123' ``` -------------------------------- ### Submit Notice Data with Form Data and HTTP Header Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Submit new notice data using a POST request with form data and the authentication token in the X-Authentication-Token HTTP header. A custom User-Agent is required. ```bash curl -kv \ -H "User-Agent: SomeUserAgentHere" \ -H "X-Authentication-Token: abc123" \ -F "notice[type]=Defamation" \ https://lumendatabase.org/notices ``` -------------------------------- ### Submit Notice Data with JSON and HTTP Header Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Submit new notice data using a POST request with JSON data and the authentication token in the X-Authentication-Token HTTP header. Specify Content-type and Accept headers. ```bash curl -H "User-Agent: SomeUserAgentHere" \ -H "Accept: application/json" \ -H "Content-type: application/json" \ -H "X-Authentication-Token: abc123" \ -d '{ "notice": {...} }' \ https://lumendatabase.org/notices ``` -------------------------------- ### Copy Database Configuration for Docker Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Copies the Docker-specific database configuration file to the main configuration file. ```bash cp config/database.yml.docker config/database.yml ``` -------------------------------- ### Create Notice Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Submits a new Notice to the Lumen system. Requires an authentication token. ```APIDOC ## POST /notices ### Description Submits a new Notice to the Lumen system. Requires an authentication token. ### Method POST ### Endpoint https://lumendatabase.org/notices ### Parameters #### Request Body - **notice** (Notice) - Required - The notice object to submit. See [Notice Type Mapping](#notice-type-mapping) for details on notice-specific attributes. - **authentication_token** (string) - Required - Your authentication token. See [Authentication](#authentication) section. ### Request Example ```json { "example": "POST /notices HTTP/1.1\nHost: lumendatabase.org\nContent-Type: application/json\nAuthorization: Bearer YOUR_AUTH_TOKEN\n\n{\"notice\": {\"type\": \"some_notice_type\", \"field1\": \"value1\"}}" } ``` ### Response #### Success Response (200 or 201) Details of the created notice. #### Response Example ```json { "example": "{\"id\": \"123\", \"type\": \"some_notice_type\", \"field1\": \"value1\", ...}" } ``` ``` -------------------------------- ### Search Entities via Fulltext Endpoint Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation This is the GET endpoint for searching entities using a full-text query. Parameters include the search term, page number, and results per page. ```http GET https://lumendatabase.org/entities/search.json?term=url_escaped_query&page=1 ``` -------------------------------- ### Request a List of Topics Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Use this curl command to request a list of available topics from the Lumen Database API. Ensure you include a User-Agent header in your request. ```bash curl -H "User-Agent: SomeUserAgentHere" https://lumendatabase.org/topics.json ``` -------------------------------- ### Example Successful DMCA Notice Response Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation This JSON structure represents a successful response when retrieving a DMCA notice from the Lumen Database. It includes details about the notice, sender, recipient, and associated works. ```json { "dmca":{ "id":1, "title":"Lion King on YouTube", "body":null, "date_sent":"2013-06-04T19:23:12Z", "date_received":"2013-06-05T20:31:44Z", "topics":[ "Anticircumvention (DMCA)", "Bookmarks", "Lumen" ], "tags": [ "tag_1", "tag_2" ], "jurisdictions": [ "US", "CA" ], "action_taken": "Partial", "sender_name": "Joe Lawyer", "recipient_name": "Google, Inc.", "works": [ { "description": "Lion King Video", "copyrighted_urls": [ { "url": "http://www.example.com/lion_king.mp4" }, { "url": "http://www.example.com/lion_king.mov" } ], "infringing_urls": [ { "url": "http://www.example.com/infringing1" }, { "url": "http://www.example.com/infringing2" }, { "url": "http://www.example.com/infringing3" } ] } ] } } ``` -------------------------------- ### Search Notices with URL Parameter Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Search for notices using the search endpoint and including the authentication token as a URL parameter. A custom User-Agent is required. ```bash curl -kv -H "User-Agent: SomeUserAgentHere" https://lumendatabase.org/notices/search.json?authentication_token=abc123 ``` -------------------------------- ### Search Notices with HTTP Header Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Search for notices using the search endpoint and including the authentication token in the X-Authentication-Token HTTP header. A custom User-Agent is required. ```bash curl -kv -H "User-Agent: SomeUserAgentHere" -H "X-Authentication-Token: abc123" https://lumendatabase.org/notices/search.json ``` -------------------------------- ### Search Notices with Query and URL Parameter Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Search for notices with specific query parameters (e.g., sender name) and include the authentication token as a URL parameter. Ensure URLs with special characters are quoted. ```bash curl -kv -H "User-Agent: SomeUserAgentHere" "https://lumendatabase.org/notices/search.json?sender_name=James+Tiberius+Kirk&authentication_token=abc123" ``` -------------------------------- ### Submit Notice as JSON Data with Entity ID Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation This snippet demonstrates submitting a notice with an entity ID using JSON data. It includes authentication headers and the notice details in JSON format. ```bash curl -v \ -H "User-Agent: SomeUserAgentHere" \ -H "Accept: application/json" \ -H "Content-type: application/json" \ -H "X-Authentication-Token: abc123" \ 'https://lumendatabase.org/notices/' \ -d '{ "notice": { "title": "DMCA (Copyright) Complaint to Google", "type": "DMCA", "subject": "Infringement Notfication via Blogger Complaint", "date_sent": "2013-05-22", "date_received": "2013-05-23", "source": "Online form", "topic_ids": [19, 27], "tag_list": "movies,disney,youtube", "jurisdiction_list": "US, CA", "action_taken": "Partial", "works_attributes": [ { "description": "Lion King Video", "copyrighted_urls_attributes": [ { "url": "http://disney.com/lion_king.mp4" }, { "url": "http://disney.com/lion_king.mov" } ], "infringing_urls_attributes": [ { "url": "http://youtube.com/bad_url_1" }, { "url": "http://youtube.com/bad_url_2" }, { "url": "http://youtube.com/bad_url_3" }, { "url": "http://youtube.com/bad_url_4" }, { "url": "http://youtube.com/bad_url_5" } ] } ], "entity_id": 1 } }' ``` -------------------------------- ### Create Notice Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation This section describes the expected responses when creating a notice via the API. It covers both successful and unsuccessful response formats. ```APIDOC ## Create Notice ### Description This endpoint is used to create a new notice in the system. Successful creation returns a 201 status code with a `Location` header pointing to the created resource. Unsuccessful requests, often due to validation errors, return a 422 status code with a JSON body detailing the errors. ### Method POST ### Endpoint `/notices` ### Parameters #### Request Body (Details not provided in source, refer to specific notice type mappings) ### Request Example (Example not provided in source) ### Response #### Success Response (201) - **Location** (string) - The URL of the created notice. #### Response Example (Success) ``` HTTP/1.1 201 Created Location: http://localhost:3000/notices/4 Content-Type: application/json; charset=utf-8 Cache-Control: max-age=0, private, must-revalidate Date: Wed, 05 Jun 2013 20:43:34 GMT Content-Length: 1 ``` #### Error Response (422) - **works** (array) - Validation errors for the 'works' field. - **entity_notice_roles** (array) - Validation errors for the 'entity_notice_roles' field. - **title** (array) - Validation errors for the 'title' field. #### Response Example (Unsuccessful) ```json { "works":["can't be blank"], "entity_notice_roles":["can't be blank"], "title":["can't be blank"] } ``` ``` -------------------------------- ### Create Notice (JSON Data) Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation This endpoint allows you to create a new notice by sending data in JSON format. It includes details about the notice, copyrighted and infringing works, and involved entities. ```APIDOC ## POST /notices ### Description Creates a new notice with detailed information about copyright infringement. ### Method POST ### Endpoint https://lumendatabase.org/notices/ ### Parameters #### Request Body - **notice** (object) - Required - Contains all details for the notice. - **title** (string) - Required - The title of the notice. - **type** (string) - Required - The type of notice (e.g., "DMCA"). - **subject** (string) - Required - The subject of the notice. - **date_sent** (string) - Required - The date the notice was sent (YYYY-MM-DD). - **date_received** (string) - Required - The date the notice was received (YYYY-MM-DD). - **source** (string) - Required - The source of the notice. - **topic_ids** (array of integers) - Optional - IDs of relevant topics. - **tag_list** (string) - Optional - Comma-separated list of tags. - **jurisdiction_list** (string) - Optional - Comma-separated list of jurisdictions. - **action_taken** (string) - Optional - The action taken regarding the notice. - **works_attributes** (array of objects) - Optional - Details about copyrighted and infringing works. - **description** (string) - Required - Description of the work. - **copyrighted_urls_attributes** (array of objects) - Optional - URLs of copyrighted works. - **url** (string) - Required - The URL of the copyrighted work. - **infringing_urls_attributes** (array of objects) - Optional - URLs of infringing works. - **url** (string) - Required - The URL of the infringing work. - **entity_notice_roles_attributes** (array of objects) - Optional - Roles of entities involved in the notice. - **name** (string) - Required - The role name (e.g., "recipient", "sender"). - **entity_attributes** (object) - Required - Attributes of the entity. - **name** (string) - Required - Name of the entity. - **kind** (string) - Required - Kind of entity (e.g., "organization", "individual"). - **address_line_1** (string) - Optional - Address line 1. - **city** (string) - Optional - City. - **state** (string) - Optional - State. - **zip** (string) - Optional - Zip code. - **country_code** (string) - Optional - Country code. - **entity_id** (integer) - Optional - The ID of the associated entity. ### Request Example ```json { "notice": { "title": "DMCA (Copyright) Complaint to Google", "type": "DMCA", "subject": "Infringement Notfication via Blogger Complaint", "date_sent": "2013-05-22", "date_received": "2013-05-23", "source": "Online form", "topic_ids": [19, 27], "tag_list": "movies, disney, youtube", "jurisdiction_list": "US, CA", "action_taken": "Partial", "works_attributes": [ { "description": "Lion King Video", "copyrighted_urls_attributes": [ { "url": "http://disney.com/lion_king.mp4" }, { "url": "http://disney.com/lion_king.mov" } ], "infringing_urls_attributes": [ { "url": "http://youtube.com/bad_url_1" }, { "url": "http://youtube.com/bad_url_2" }, { "url": "http://youtube.com/bad_url_3" }, { "url": "http://youtube.com/bad_url_4" }, { "url": "http://youtube.com/bad_url_5" } ] } ], "entity_notice_roles_attributes": [ { "name": "recipient", "entity_attributes": { "name": "Google", "kind": "organization", "address_line_1": "1600 Amphitheatre Parkway", "city": "Mountain View", "state": "CA", "zip": "94043", "country_code": "US" } }, { "name": "sender", "entity_attributes": { "name": "Joe Lawyer", "kind": "individual", "address_line_1": "1234 Anystreet St.", "city": "Anytown", "state": "CA", "zip": "94044", "country_code": "US" } } ], "entity_id": 1 } } ``` ``` -------------------------------- ### GNU General Public License - Preamble Source: https://berkman-klein-center.gitbook.io/lumen-database/other/license The preamble of the GNU General Public License explains the purpose of the license, emphasizing user freedoms and the intent to keep software free. ```plaintext Preamble ``` -------------------------------- ### Access Website Container via Bash Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Executes a bash shell inside the website container for further commands. ```bash docker-compose exec website bash ``` -------------------------------- ### Search Notices via Fulltext (cURL) Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Use this cURL command to search for notices in the Lumen Database. Ensure you include the User-Agent and Accept headers. ```bash curl -H "User-Agent: SomeUserAgentHere" -H "Accept: application/json" -H "Content-type: application/json" 'https://lumendatabase.org/notices/search?term=star' ``` -------------------------------- ### GNU General Public License - Terms and Conditions Source: https://berkman-klein-center.gitbook.io/lumen-database/other/license This section outlines the specific terms and conditions for copying, distribution, and modification under the GNU General Public License. ```plaintext TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ``` -------------------------------- ### Search Notices via Fulltext Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation This endpoint allows for paginatable full-text searches of notices. You can specify search terms, sender names, and page numbers. Consider requesting gzipped content for extensive results. ```bash https://Lumendatabase.org/notices/search?term=url_escaped_query&sender_name=Joe%20Smith&page=1 ``` -------------------------------- ### Submit Notice as JSON Data Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Use this snippet to submit a new notice to the Lumen Database API using JSON data. Ensure the 'Accept' and 'Content-type' headers are set to 'application/json'. ```bash curl -v \ -H "User-Agent: SomeUserAgentHere" \ -H "Accept: application/json" \ -H "Content-type: application/json" \ 'https://lumendatabase.org/notices/' \ -d '{ "notice": { "title": "DMCA (Copyright) Complaint to Google", "type": "DMCA", "subject": "Infringement Notfication via Blogger Complaint", "date_sent": "2013-05-22", "date_received": "2013-05-23", "source": "Online form", "topic_ids": [19, 27], "tag_list": "movies,disney,youtube", "jurisdiction_list": "US, CA", "action_taken": "Partial", "works_attributes": [ { "description": "Lion King Video", "copyrighted_urls_attributes": [ { "url": "http://disney.com/lion_king.mp4" }, { "url": "http://disney.com/lion_king.mov" } ], "infringing_urls_attributes": [ { "url": "http://youtube.com/bad_url_1" }, { "url": "http://youtube.com/bad_url_2" }, { "url": "http://youtube.com/bad_url_3" }, { "url": "http://youtube.com/bad_url_4" }, { "url": "http://youtube.com/bad_url_5" } ] } ], "entity_notice_roles_attributes": [ { "name": "recipient", "entity_attributes": { "name": "Google", "kind": "organization", "address_line_1": "1600 Amphitheatre Parkway", "city": "Mountain View", "state": "CA", "zip": "94043", "country_code": "US" } }, { "name": "sender", "entity_attributes": { "name": "Joe Lawyer", "kind": "individual", "address_line_1": "1234 Anystreet St.", "city": "Anytown", "state": "CA", "zip": "94044", "country_code": "US" } } ] } }' ``` -------------------------------- ### Submit Notice Data as Form Data using curl Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Use this method when attaching files to a notice. The '@' symbol in curl specifies a local file. ```bash curl -kv \ -H "User-Agent: SomeUserAgentHere" \ -H "X-Authentication-Token: abc123" \ -F "notice[type]=Defamation" \ -F "notice[title]=Defamation report via form data" \ -F "notice[file_uploads_attributes][0][kind]=original" \ -F "notice[file_uploads_attributes][0][file]=@Defamation complaint.docx" \ -F "notice[works_attributes][0][infringing_urls_attributes][0][url]=http://www.bad.com/people/296" \ https://lumendatabase.org/notices ``` -------------------------------- ### Copy Environment Variables for Docker Source: https://berkman-klein-center.gitbook.io/lumen-database/development/installation-and-development Copies the Docker-specific environment variables file to the main environment file. ```bash cp .env.docker .env ``` -------------------------------- ### Submit a Notice Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Submits a new notice to the Lumen Database. Authentication is required. Data can be sent as JSON or form data. ```APIDOC ## POST /notices ### Description Submits a new notice to the Lumen Database. Authentication is required. ### Method POST ### Endpoint https://lumendatabase.org/notices ### Parameters #### Query Parameters - **authentication_token** (string) - Required - Your authentication token for accessing the API. #### Request Headers - **User-Agent** (string) - Required - A custom user agent string. Default user agents are blocked. - **Accept** (string) - Required - Specifies the desired response format, e.g., `application/json`. - **Content-type** (string) - Required - Specifies the format of the request body, e.g., `application/json` or `multipart/form-data`. - **X-Authentication-Token** (string) - Required - Your authentication token for accessing the API. #### Request Body - **notice** (object) - Required - Contains the notice data. The structure of this object depends on the notice type. - **notice[type]** (string) - Required - The type of the notice (e.g., 'Defamation'). ### Request Example (JSON Body) ```http POST https://lumendatabase.org/notices?authentication_token=abc123 Content-Type: application/json { "notice": {...} } ``` ### Request Example (Form Data) ```http POST https://lumendatabase.org/notices Content-Type: multipart/form-data X-Authentication-Token: abc123 -F "notice[type]=Defamation" ``` ### Response #### Success Response (200 or 201) Returns a JSON-encoded representation of the newly created notice. ``` -------------------------------- ### Create Notice (Form Data) Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation This endpoint allows you to create a new notice by sending data as form fields. This method is useful for submitting data from web forms. ```APIDOC ## POST /notices ### Description Creates a new notice using form data, suitable for web form submissions. ### Method POST ### Endpoint https://lumendatabase.org/notices ### Parameters #### Request Body - **notice[type]** (string) - Required - The type of notice (e.g., "DMCA"). - **notice[title]** (string) - Required - The title of the notice. - **notice[subject]** (string) - Required - The subject of the notice. - **notice[date_sent]** (string) - Required - The date the notice was sent (YYYY-MM-DD). - **notice[date_received]** (string) - Required - The date the notice was received (YYYY-MM-DD). - **notice[source]** (string) - Required - The source of the notice. - **notice[body]** (string) - Optional - The main body of the notice. - **notice[topic_ids][]** (integer) - Optional - IDs of relevant topics (can be repeated). - **notice[tag_list]** (string) - Optional - Comma-separated list of tags. - **notice[jurisdiction_list]** (string) - Optional - Comma-separated list of jurisdictions. - **notice[action_taken]** (string) - Optional - The action taken regarding the notice. - **notice[file_uploads_attributes][N][kind]** (string) - Optional - Kind of file upload (e.g., "original", "supporting"). - **notice[file_uploads_attributes][N][file]** (file) - Optional - The file to upload. - **notice[works_attributes][N][description]** (string) - Required - Description of the work. - **notice[works_attributes][N][copyrighted_urls_attributes][M][url]** (string) - Optional - URL of the copyrighted work. - **notice[works_attributes][N][infringing_urls_attributes][M][url]** (string) - Optional - URL of the infringing work. - **notice[entity_id]** (integer) - Optional - The ID of the associated entity. ### Request Example ```curl curl -kv \ -H "User-Agent: SomeUserAgentHere" \ -H "X-Authentication-Token: abc123" \ -F "notice[type]=DMCA" \ -F "notice[title]=DMCA (Copyright) Complaint to Google" \ -F "notice[subject]=Infringement Notfication via Blogger Complaint" \ -F "notice[date_sent]=2014-07-04" \ -F "notice[date_received]=2014-07-04" \ -F "notice[source]=Online form" \ -F "notice[body]=Victim of Infringement requests removal of content on Blogger." \ -F "notice[topic_ids][]=19", \ -F "notice[topic_ids][]=27", \ -F "notice[tag_list]=movies,disney,youtube", \ -F "notice[jurisdiction_list]=US, CA", \ -F "notice[action_taken]=Partial", \ -F "notice[file_uploads_attributes][0][kind]=original" \ -F "notice[file_uploads_attributes][0][file]=@original_file.txt" \ -F "notice[file_uploads_attributes][1][kind]=supporting" \ -F "notice[file_uploads_attributes][1][file]=@supporting_file.txt" \ -F "notice[works_attributes][0][description]=Lion King Video" \ -F "notice[works_attributes][0][copyrighted_urls_attributes][0][url]=http://disney.com/lion_king.mp4" \ -F "notice[works_attributes][0][copyrighted_urls_attributes][0][url]=http://disney.com/lion_king.mov" \ -F "notice[works_attributes][0][infringing_urls_attributes][0][url]=http://youtube.com/bad_url_1" \ -F "notice[works_attributes][0][infringing_urls_attributes][0][url]=http://youtube.com/bad_url_2" \ -F "notice[works_attributes][0][infringing_urls_attributes][0][url]=http://youtube.com/bad_url_3" \ -F "notice[works_attributes][0][infringing_urls_attributes][0][url]=http://youtube.com/bad_url_4" \ -F "notice[works_attributes][0][infringing_urls_attributes][0][url]=http://youtube.com/bad_url_5" \ -F "notice[entity_id]=1" \ https://lumendatabase.org/notices ``` ``` -------------------------------- ### Submit Notice Data as JSON Data using curl Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Use this method when not submitting file attachments for simpler syntax. Ensure 'Content-type' is set to 'application/json'. ```bash curl -H "User-Agent: SomeUserAgentHere" \ -H "Accept: application/json" \ -H "X-Authentication-Token: abc123" \ -H "Content-type: application/json" \ -d '{ "notice": { "type": "Defamation", "title": "Defamation report via JSON data" } }' \ https://lumendatabase.org/notices ``` -------------------------------- ### List Topics Source: https://berkman-klein-center.gitbook.io/lumen-database/api/documentation Retrieves a paginatable list of all topics available in the Lumen Database. Each topic includes its unique ID, name, and parent topic ID. ```APIDOC ## GET /topics.json ### Description Retrieves a JSON-encoded array of topics. Each topic object contains an `id`, `name`, and `parent_id`. ### Method GET ### Endpoint https://lumendatabase.org/topics.json ### Parameters None ### Request Example ```curl curl -H "User-Agent: SomeUserAgentHere" https://lumendatabase.org/topics.json ``` ### Response #### Success Response (200) Returns a JSON array of topic objects, each with the following attributes: - `id` (Integer) - The unique ID used for the `topic_ids` array during notice creation. - `name` (String) - The topic name. - `parent_id` (Integer) - The parent `topic_id` of this topic, or "null" if this is a root topic. #### Response Example ```json { "topics": [ { "id": 1, "name": "Lumen", "parent_id": null }, { "id": 2, "name": "Copyright", "parent_id": null }, { "id": 3, "name": "Anticircumvention (DMCA)", "parent_id": 2 } ] } ``` ```