{"_id":"59d1716e099d180024efc15d","project":"568bdc1483d2061900d86cdc","version":{"_id":"59a72290d61777001b6c42c3","project":"568bdc1483d2061900d86cdc","__v":19,"createdAt":"2017-08-30T20:39:44.453Z","releaseDate":"2017-08-30T20:39:44.453Z","categories":["59a7236e3fe4d90025117c10","59a72eb6cb0db3001b84cfe2","59a734eb757d030019b85af8","59c0243b1b2d07001a9d2b76","59c035e42126e10028effb12","59c06c40df5b3c0010584a13","59c1a5852cabe5002641a3e7","59c2fb00b2b45c0010b7a3d7","59c32ceb9aea850010ac4130","59c32e6e190c90003cb0d12f","59c33affb2b45c0010b7aa23","59c7dfa457bd8200105444dc","59c7e975c50cf30010d712a0","59cffdef0cd4dd0010294d54","59d0622ca91a810032c8f60c","59d06733c1aec60026253065","59d174d44ac471001a07b123","59d5a5e323e6e800103defb2","59ecf1d8ed507c001c52b255"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.0.0","version":"0"},"category":{"_id":"59a734eb757d030019b85af8","project":"568bdc1483d2061900d86cdc","version":"59a72290d61777001b6c42c3","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-08-30T21:58:03.883Z","from_sync":false,"order":6,"slug":"rest-api-usage","title":"REST API Usage"},"user":"58cc41f21751ce2f003be3b7","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-10-01T22:51:26.077Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"# Overview\n\nEvery URL in the API can be accessed using OPTIONS, without any authentication needed. The Droplit system will return a JSON object which contains all the possible methods that can be called on that URL, with their associated parameters, in a format similar to [Swagger](http://swagger.io). For each REST method, parameters found in the path, query string, and request body are listed. Header parameters are not currently listed, but may be in the future. Any header parameters associated with endpoints can be found in the specific documentation for that endpoint.\n\n# OPTIONS Key-Value Reference\n\n## Top-Level Option\nThe top-level options in the JSON structure are the REST options that the given URL supports: DELETE, GET, POST, or PUT. A URL can support any combination of these at once, as needed.\n\n## in\nA string showing where the parameter is located when making an API call. This should be present in all parameter definitions.\n* body: The parameter is located in the request's message body.\n* path: The parameter is located in the request's URL path.\n* query: The parameter is located in the request's query string.\n\n## type\nA string showing the data type of the parameter. This should be present in all parameter definitions. Acceptable values are one of the following.\n* string\n* number\n* integer\n* object\n* array\n* boolean\n\n## required\nA boolean value showing whether the parameter is required for the request to function properly. This should be present in all parameter definitions.\n\n## enum\nThis key is an array representing a fixed set of values the parameter may be. These values may be of any valid type.\n\n```\n\"expiryType\": {\n    \"in\": \"query\",\n    \"type\": \"string\",\n    \"required\": false,\n    \"enum\": [ \"Infinite\", \"FixedTtl\", \"SlidingTtl\" ]\n}\n```\n\n## items\nThis key must be present if the type of parameter is “array.” It describes the type of items that are contained within an array, and uses its own “type” parameter inside an object.\n\n```\n\"services\": {\n    \"in\": \"body\",\n    \"type\": \"array\",\n    \"required\": false,\n    \"items\": { \"type\": \"string\" }\n}\n```\n\n## match\nThis key may only be present if the type of parameter is “string.” It describes a regex expression pattern (RegExp) that the string must adhere to.\n\n## minLength\nThis key may only be present if the type of parameter is a “string.” It is an integer value representing the minimum length (inclusive) that the parameter may be.\n\n## maxLength\nThis key may only be present if the type of parameter is a “string.” It is an integer value representing the maximum length (inclusive) that the parameter may be.\n\n## minimum\nThis key may only be present if the type of parameter is “number” or “integer.” It describes the minimum value (inclusive) that the parameter may be.\n\n## maximum\nThis key may only be present if the type of parameter is “number” or “integer.” It describes the maximum value (inclusive) that the parameter may be.\n\n# OPTIONS JSON Examples\n\nSome header fields have been removed from these examples for clarity.\n\n```\nOPTIONS https://ioe.droplit.io/api/ecosystems\nHTTP/1.1 200 OK\naccess-control-allow-origin: *\naccess-control-allow-methods: GET,POST,OPTIONS\n\n{\n    \"get\": {\n        \"description\": \"List all ecosystems\"\n    },\n    \"post\": {\n        \"description\": \"Create an ecosystem\",\n        \"parameters\": {\n            \"meta\": {\n            \t\"in\": \"body\",\n                \"type\": \"object\",\n                \"required\": false\n            }\n        }\n    }\n}\n```\n\n```\nOPTIONS https://ioe.droplit.io/api/ecosystems/C57146c78149e6c3039e708b6\nHTTP/1.1 200 OK\naccess-control-allow-origin: *\naccess-control-allow-methods: DELETE,GET,PUT,OPTIONS\n\n{\n    \"delete\": {\n        \"description\": \"Delete a specified ecosystem\",\n        \"parameters\": {\n            \"id\": {\n            \t\"in\": \"path\",\n                \"type\": \"string\",\n                \"match\": \"^[A-Z]{1}[a-z0-9]{24}$\",\n                \"required\": true\n            }\n        }\n    },\n    \"get\": {\n        \"description\": \"Get a specified ecosystem\",\n        \"parameters\": {\n            \"id\": {\n            \t\"in\": \"path\",\n                \"type\": \"string\",\n                \"match\": \"^[A-Z]{1}[a-z0-9]{24}$\",\n                \"required\": true\n            }\n        }\n    },\n    \"put\": {\n        \"description\": \"Update a specified ecosystem\",\n        \"parameters\": {\n            \"meta\": {\n            \t\"in\": \"body\",\n                \"type\": \"object\",\n                \"required\": false\n            },\n            \"id\": {\n            \t\"in\": \"path\",\n                \"type\": \"string\",\n                \"match\": \"^[A-Z]{1}[a-z0-9]{24}$\",\n                \"required\": true\n            }\n        }\n    }\n}\n```","excerpt":"","slug":"rest-api-endpoint-discovery","type":"basic","title":"Endpoint Discovery"}

Endpoint Discovery


# Overview Every URL in the API can be accessed using OPTIONS, without any authentication needed. The Droplit system will return a JSON object which contains all the possible methods that can be called on that URL, with their associated parameters, in a format similar to [Swagger](http://swagger.io). For each REST method, parameters found in the path, query string, and request body are listed. Header parameters are not currently listed, but may be in the future. Any header parameters associated with endpoints can be found in the specific documentation for that endpoint. # OPTIONS Key-Value Reference ## Top-Level Option The top-level options in the JSON structure are the REST options that the given URL supports: DELETE, GET, POST, or PUT. A URL can support any combination of these at once, as needed. ## in A string showing where the parameter is located when making an API call. This should be present in all parameter definitions. * body: The parameter is located in the request's message body. * path: The parameter is located in the request's URL path. * query: The parameter is located in the request's query string. ## type A string showing the data type of the parameter. This should be present in all parameter definitions. Acceptable values are one of the following. * string * number * integer * object * array * boolean ## required A boolean value showing whether the parameter is required for the request to function properly. This should be present in all parameter definitions. ## enum This key is an array representing a fixed set of values the parameter may be. These values may be of any valid type. ``` "expiryType": { "in": "query", "type": "string", "required": false, "enum": [ "Infinite", "FixedTtl", "SlidingTtl" ] } ``` ## items This key must be present if the type of parameter is “array.” It describes the type of items that are contained within an array, and uses its own “type” parameter inside an object. ``` "services": { "in": "body", "type": "array", "required": false, "items": { "type": "string" } } ``` ## match This key may only be present if the type of parameter is “string.” It describes a regex expression pattern (RegExp) that the string must adhere to. ## minLength This key may only be present if the type of parameter is a “string.” It is an integer value representing the minimum length (inclusive) that the parameter may be. ## maxLength This key may only be present if the type of parameter is a “string.” It is an integer value representing the maximum length (inclusive) that the parameter may be. ## minimum This key may only be present if the type of parameter is “number” or “integer.” It describes the minimum value (inclusive) that the parameter may be. ## maximum This key may only be present if the type of parameter is “number” or “integer.” It describes the maximum value (inclusive) that the parameter may be. # OPTIONS JSON Examples Some header fields have been removed from these examples for clarity. ``` OPTIONS https://ioe.droplit.io/api/ecosystems HTTP/1.1 200 OK access-control-allow-origin: * access-control-allow-methods: GET,POST,OPTIONS { "get": { "description": "List all ecosystems" }, "post": { "description": "Create an ecosystem", "parameters": { "meta": { "in": "body", "type": "object", "required": false } } } } ``` ``` OPTIONS https://ioe.droplit.io/api/ecosystems/C57146c78149e6c3039e708b6 HTTP/1.1 200 OK access-control-allow-origin: * access-control-allow-methods: DELETE,GET,PUT,OPTIONS { "delete": { "description": "Delete a specified ecosystem", "parameters": { "id": { "in": "path", "type": "string", "match": "^[A-Z]{1}[a-z0-9]{24}$", "required": true } } }, "get": { "description": "Get a specified ecosystem", "parameters": { "id": { "in": "path", "type": "string", "match": "^[A-Z]{1}[a-z0-9]{24}$", "required": true } } }, "put": { "description": "Update a specified ecosystem", "parameters": { "meta": { "in": "body", "type": "object", "required": false }, "id": { "in": "path", "type": "string", "match": "^[A-Z]{1}[a-z0-9]{24}$", "required": true } } } } ```