{"__v":0,"_id":"588f722cbcace50f0052ba25","category":{"version":"588f722bbcace50f0052b9e1","project":"565f5fa26bafd40d0030a064","_id":"588f722bbcace50f0052b9e6","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-25T18:09:36.891Z","from_sync":false,"order":4,"slug":"dashboard-api","title":"Dashboard API"},"parentDoc":null,"project":"565f5fa26bafd40d0030a064","user":"565f3941ea46251700972783","version":{"__v":1,"_id":"588f722bbcace50f0052b9e1","project":"565f5fa26bafd40d0030a064","createdAt":"2017-01-30T17:04:43.410Z","releaseDate":"2017-01-30T17:04:43.410Z","categories":["588f722bbcace50f0052b9e2","588f722bbcace50f0052b9e3","588f722bbcace50f0052b9e4","588f722bbcace50f0052b9e5","588f722bbcace50f0052b9e6","588f722bbcace50f0052b9e7"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"5.3.0","version":"5.3.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-24T00:23:04.254Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"curl","code":"curl -b cookies.txt -c cookies.txt -H \"Content-Type: application/json\" -X PUT -d '{\"api\":{\"name\":\"Product API\",\"base_url\":\"https://garrulous-leather-9718.nanoscale.io\",\"description\":\"\",\"cors_allow_origin\":\"*\",\"cors_allow_headers\":\"content-type, accept\",\"cors_allow_credentials\":true,\"cors_request_headers\":\"*\",\"cors_max_age\":600,\"enable_swagger\":false,\"export\":null}}' \"https://api.nanoscale.io/apis/104\""}]},"method":"put","results":{"codes":[{"name":"","code":"{\n    \"api\": {\n        \"id\": 104,\n        \"name\": \"Product API\",\n        \"description\": \"\",\n        \"cors_allow_origin\": \"*\",\n        \"cors_allow_headers\": \"content-type, accept\",\n        \"cors_allow_credentials\": true,\n        \"cors_request_headers\": \"*\",\n        \"cors_max_age\": 600,\n        \"enable_swagger\": false,\n        \"base_url\": \"https://garrulous-leather-9718.nanoscale.io\"\n    }\n}","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"56ccf7e8723ad71d00cae488","ref":"","in":"path","required":true,"desc":"","default":"","type":"string","name":"id"}],"url":"/apis/:id"},"isReference":true,"order":9,"body":"Updates a single api.\n\nHere is a list of fields that can be provided.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"key\",\n    \"h-1\": \"type\",\n    \"h-2\": \"description\",\n    \"0-0\": \"id\",\n    \"1-0\": \"name\",\n    \"2-0\": \"description\",\n    \"3-0\": \"cors_allow_origin\",\n    \"4-0\": \"cors_allow_headers\",\n    \"5-0\": \"cors_allow_credentials\",\n    \"6-0\": \"cors_request_headers\",\n    \"7-0\": \"cors_max_age\",\n    \"8-0\": \"enable_swagger\",\n    \"9-0\": \"base_url\",\n    \"0-1\": \"`number`\",\n    \"1-1\": \"`string`\",\n    \"2-1\": \"`string`\",\n    \"4-1\": \"`string`\",\n    \"3-1\": \"`string`\",\n    \"6-1\": \"`string`\",\n    \"9-1\": \"`string`\",\n    \"5-1\": \"`boolean`\",\n    \"8-1\": \"`boolean`\",\n    \"7-1\": \"`number`\",\n    \"0-2\": \"The api identifier.\",\n    \"1-2\": \"The name of the api.\",\n    \"2-2\": \"The description of the api.\",\n    \"3-2\": \"Specifies a URI that may access the api. The browser must enforce this.  For requests without credentials, the api may specify `\\\"*\\\"` as a wildcard, thereby allowing any origin to access the resource.\\n\\nIf the server specifies an origin host rather than `\\\"*\\\"`, then it must also include `Origin` in the `Vary` response header to indicate to clients that server responses will differ based on the value of the `Origin` request header.\",\n    \"4-2\": \"Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.\",\n    \"5-2\": \"Indicates whether or not the response to the request can be exposed when the credentials flag is true.  When used as part of a response to a preflight request, this indicates whether or not the actual request can be made using credentials.  Note that simple GET requests are not preflighted, and so if a request is made for a resource with credentials, if this header is not returned with the resource, the response is ignored by the browser and not returned to web content.\",\n    \"6-2\": \"TODO\",\n    \"7-2\": \"Indicates how long the results of a preflight request can be cached in seconds.\",\n    \"8-2\": \"Indicates whether Swagger documentation is enabled.\",\n    \"9-2\": \"The base url of the api.\"\n  },\n  \"cols\": 3,\n  \"rows\": 10\n}\n[/block]\nHere is an example of the `JSON` used to update an api:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"api\\\": {\\n        \\\"name\\\": \\\"Product API\\\",\\n        \\\"base_url\\\": \\\"https://garrulous-leather-9718.nanoscale.io\\\",\\n        \\\"description\\\": \\\"\\\",\\n        \\\"cors_allow_origin\\\": \\\"*\\\",\\n        \\\"cors_allow_headers\\\": \\\"content-type, accept\\\",\\n        \\\"cors_allow_credentials\\\": true,\\n        \\\"cors_request_headers\\\": \\\"*\\\",\\n        \\\"cors_max_age\\\": 600,\\n        \\\"enable_swagger\\\": false,\\n        \\\"export\\\": null\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"apisid-1","type":"endpoint","title":"/apis/:id"}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
string

Examples


Result Format


Documentation

Updates a single api. Here is a list of fields that can be provided. [block:parameters] { "data": { "h-0": "key", "h-1": "type", "h-2": "description", "0-0": "id", "1-0": "name", "2-0": "description", "3-0": "cors_allow_origin", "4-0": "cors_allow_headers", "5-0": "cors_allow_credentials", "6-0": "cors_request_headers", "7-0": "cors_max_age", "8-0": "enable_swagger", "9-0": "base_url", "0-1": "`number`", "1-1": "`string`", "2-1": "`string`", "4-1": "`string`", "3-1": "`string`", "6-1": "`string`", "9-1": "`string`", "5-1": "`boolean`", "8-1": "`boolean`", "7-1": "`number`", "0-2": "The api identifier.", "1-2": "The name of the api.", "2-2": "The description of the api.", "3-2": "Specifies a URI that may access the api. The browser must enforce this. For requests without credentials, the api may specify `\"*\"` as a wildcard, thereby allowing any origin to access the resource.\n\nIf the server specifies an origin host rather than `\"*\"`, then it must also include `Origin` in the `Vary` response header to indicate to clients that server responses will differ based on the value of the `Origin` request header.", "4-2": "Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.", "5-2": "Indicates whether or not the response to the request can be exposed when the credentials flag is true. When used as part of a response to a preflight request, this indicates whether or not the actual request can be made using credentials. Note that simple GET requests are not preflighted, and so if a request is made for a resource with credentials, if this header is not returned with the resource, the response is ignored by the browser and not returned to web content.", "6-2": "TODO", "7-2": "Indicates how long the results of a preflight request can be cached in seconds.", "8-2": "Indicates whether Swagger documentation is enabled.", "9-2": "The base url of the api." }, "cols": 3, "rows": 10 } [/block] Here is an example of the `JSON` used to update an api: [block:code] { "codes": [ { "code": "{\n \"api\": {\n \"name\": \"Product API\",\n \"base_url\": \"https://garrulous-leather-9718.nanoscale.io\",\n \"description\": \"\",\n \"cors_allow_origin\": \"*\",\n \"cors_allow_headers\": \"content-type, accept\",\n \"cors_allow_credentials\": true,\n \"cors_request_headers\": \"*\",\n \"cors_max_age\": 600,\n \"enable_swagger\": false,\n \"export\": null\n }\n}", "language": "json" } ] } [/block]