{ "swagger" : "2.0", "info" : { "description" : "The Digital Linguistics (DLx) database API", "version" : "0.1.0", "title" : "DLx", "contact" : { "name" : "Daniel W. Hieber", "url" : "http://danielhieber.com/", "email" : "dhieber@umail.ucsb.edu" }, "license" : { "name" : "MIT" } }, "host" : "api.digitallinguistics.io", "basePath" : "/v0", "tags" : [ { "name" : "Language", "description" : "Operations on Languages" } ], "schemes" : [ "https" ], "consumes" : [ "application/json" ], "produces" : [ "application/json" ], "security" : [ { "token" : [ ] } ], "paths" : { "/languages" : { "get" : { "tags" : [ "Language" ], "summary" : "Get all Languages", "description" : "Retrieves all the resources that the authenticated user or client has permission to access.", "operationId" : "getLanguages", "parameters" : [ { "name" : "continuation", "in" : "header", "description" : "The `dlx-continuation` header is used to send a continuation token with the request, when retrieving the next page of results.", "required" : false, "type" : "string" }, { "name" : "maxItems", "in" : "header", "description" : "The `dlx-max-item-count` header is used to limit the number of results to a certain amount at a time (by default all results will be returned). If there are more results to be returned, a continuation token will also be sent in the `dlx-continuation` header.", "required" : false, "type" : "string" } ], "responses" : { "200" : { "description" : "Operation successful." } } }, "post" : { "tags" : [ "Language" ], "summary" : "Add a new Language", "operationId" : "addLanguage", "parameters" : [ { "in" : "body", "name" : "body", "description" : "A database resource to upsert", "required" : true, "schema" : { "$ref" : "#/definitions/Document" } } ], "responses" : { "201" : { "description" : "The resource was created successfully." } } }, "put" : { "tags" : [ "Language" ], "summary" : "Upsert (create or replace) a Language", "description" : "Creates a Language if it does not yet exist (i.e. if the resource does not have an `id` property yet), or replaces the existing Language resource if it does. Note that this replaces the *entire* Language object. It is not just a partial update.", "operationId" : "upsertLanguage", "parameters" : [ { "in" : "body", "name" : "body", "description" : "A database resource to upsert", "required" : true, "schema" : { "$ref" : "#/definitions/Document" } }, { "name" : "ifMatch", "in" : "header", "description" : "The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.", "required" : false, "type" : "string" } ], "responses" : { "201" : { "description" : "Upsert successful." } } } }, "/languages/{languageId}" : { "get" : { "tags" : [ "Language" ], "summary" : "Retrieve a Language by ID", "operationId" : "getLanguage", "parameters" : [ { "name" : "languageId", "in" : "path", "description" : "The ID of the Language to perform the operation on", "required" : true, "type" : "string" }, { "name" : "ifNoneMatch", "in" : "header", "description" : "If `If-None-Match` header is used with GET requests to check whether you already have the most up-to-date version of the resource, and therefore do not need the resource sent again. The value of the `If-None-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to reduce bandwidth.", "required" : false, "type" : "string" } ], "responses" : { "200" : { "description" : "Operation successful." } } }, "delete" : { "tags" : [ "Language" ], "summary" : "Delete a Language by ID", "operationId" : "deleteLanguage", "parameters" : [ { "name" : "languageId", "in" : "path", "description" : "The ID of the Language to perform the operation on", "required" : true, "type" : "string" }, { "name" : "ifMatch", "in" : "header", "description" : "The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.", "required" : false, "type" : "string" } ], "responses" : { "204" : { "description" : "Delete operation successful." } } }, "patch" : { "tags" : [ "Language" ], "summary" : "Perform a partial update on a Language", "description" : "Performs a partial update the Language whose ID is specified in the URL. If the Language object has an `id` property, is ignore in favor of the ID in the URL.", "operationId" : "updateLanguage", "parameters" : [ { "name" : "languageId", "in" : "path", "description" : "The ID of the Language to perform the operation on", "required" : true, "type" : "string" }, { "in" : "body", "name" : "body", "description" : "A database resource to upsert", "required" : true, "schema" : { "$ref" : "#/definitions/Document" } }, { "name" : "ifMatch", "in" : "header", "description" : "The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.", "required" : false, "type" : "string" } ], "responses" : { "200" : { "description" : "Update successful." } } } } }, "securityDefinitions" : { "token" : { "description" : "An access token (JSON Web Token) included in the `Authorization` header. Tokens may be retrieved programmatically from https://digitallinguistics.auth0.com. See the authorization documentation at http://developer.digitallinguistics.io/api/.", "type" : "apiKey", "name" : "token", "in" : "header" } }, "definitions" : { "Document" : { "type" : "object", "required" : [ "type" ], "properties" : { "id" : { "type" : "string" }, "type" : { "type" : "string" } }, "title" : "Document", "description" : "A document in the DLx database" } }, "parameters" : { "body" : { "in" : "body", "name" : "body", "description" : "A database resource to upsert", "required" : true, "schema" : { "$ref" : "#/definitions/Document" } }, "continuation" : { "name" : "continuation", "in" : "header", "description" : "The `dlx-continuation` header is used to send a continuation token with the request, when retrieving the next page of results.", "required" : false, "type" : "string" }, "ifMatch" : { "name" : "ifMatch", "in" : "header", "description" : "The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.", "required" : false, "type" : "string" }, "ifNoneMatch" : { "name" : "ifNoneMatch", "in" : "header", "description" : "If `If-None-Match` header is used with GET requests to check whether you already have the most up-to-date version of the resource, and therefore do not need the resource sent again. The value of the `If-None-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to reduce bandwidth.", "required" : false, "type" : "string" }, "maxItems" : { "name" : "maxItems", "in" : "header", "description" : "The `dlx-max-item-count` header is used to limit the number of results to a certain amount at a time (by default all results will be returned). If there are more results to be returned, a continuation token will also be sent in the `dlx-continuation` header.", "required" : false, "type" : "string" } }, "responses" : { "BadRequest" : { "description" : "There was a problem with the request." }, "Conflict" : { "description" : "There was a data conflict in the database." }, "Created" : { "description" : "The resource was created successfully." }, "DeleteSuccessful" : { "description" : "Delete operation successful." }, "Forbidden" : { "description" : "Unauthorized." }, "LargePayload" : { "description" : "Request payload is too large." }, "MethodNotAllowed" : { "description" : "Method not allowed." }, "NotAcceptable" : { "description" : "Cannot return data in requested format." }, "NotFound" : { "description" : "Database resource not found." }, "ServerError" : { "description" : "An error occurred on the server." }, "Success" : { "description" : "Operation successful." }, "TokenExpired" : { "description" : "Access token expired." }, "TooManyRequests" : { "description" : "Too many requests." }, "Unauthorized" : { "description" : "Authorization missing or invalid." }, "UpdateSuccessful" : { "description" : "Update successful." }, "UpsertSuccessful" : { "description" : "Upsert successful." } }, "externalDocs" : { "description" : "How to use the API", "url" : "http://developer.digitallinguistics.io/api/" } }