{"__v":0,"_id":"588f722bbcace50f0052b9ef","category":{"version":"588f722bbcace50f0052b9e1","project":"565f5fa26bafd40d0030a064","_id":"588f722bbcace50f0052b9e3","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-09T21:22:52.427Z","from_sync":false,"order":1,"slug":"user-guide","title":"Reference"},"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":["57e550c5a29afa0e00d31297","57ea88c71780cd170064f27c"],"next":{"pages":[],"description":""},"createdAt":"2015-12-09T21:55:54.796Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"The “Build” link on the nanoscale.io main home page will take you directly to the APIs view, which shows a list of existing APIs.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/8EZXf9pKSuyMv1MDmF5X_apis.png\",\n        \"apis.png\",\n        \"1435\",\n        \"541\",\n        \"#5e8fc5\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## Creating a new API\n\nWhen creating a new API, you have the option to Import a file with pre-existing API definitions, such as the samples.json file that is referenced in your welcome email and available <a target=\"_blank\" href=\"http://downloads.nanoscale.io/latest/samples.json\">here</a>.\n\nFrom the APIs view, you can also Export, Edit and Delete existing APIs by hovering your cursor over the API row and selecting the corresponding Export, Edit, or Delete icon:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/Nfy4NMLSX2qelVJWnQzQ_api-manip.png\",\n        \"api-manip.png\",\n        \"1342\",\n        \"172\",\n        \"#9e845b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## Exporting an API\n\nExporting an API will enable you to download a complete export of the API definition in a JSON file, including corresponding definitions for all Proxy Endpoints, Remote Endpoints, Environments, Hosts, Shared Libraries, and Groups.  This capability is useful for sharing APIs with other developers, or migrating across nanoscale.io instances.\n \n## Deleting an API\n\nYou can delete an API and the corresponding sub components (Proxy Endpoints, Remote Endpoints, etc.). You will be prompted with a confirmation dialog when deleting an API.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Perform this operation with care; there is no undo. Export your API first as a backup, just in case.\",\n  \"title\": \"Be careful!\"\n}\n[/block]\n## Editing an API\nTo define or edit the sub-components of the API, such as Proxy Endpoints and Remote Endpoints, you can click on the API name and you will be taken to the next level of views, starting at the Proxy Endpoints view.\n \nTo edit the properties of an API, hover over the API row and select the edit/pencil icon. This will take you to a view with additional API properties:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/aJWChRfnT8WR6QTFrjNg_edit-api.png\",\n        \"edit-api.png\",\n        \"1435\",\n        \"752\",\n        \"#6282a6\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## API Properties\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"The following CORS related parameters are applied at the API level. Developer can control to enable/disable this at each endpoint level. For more details on these parameters, please <a target=\\\"_blank\\\" href=\\\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS\\\">see</a>.\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Name\",\n    \"1-0\": \"Description\",\n    \"2-0\": \"CORS allowed origin\",\n    \"3-0\": \"CORS Allowed headers\",\n    \"4-0\": \"CORS allow credentials\",\n    \"5-0\": \"CORS request headers\",\n    \"6-0\": \"CORS max age\",\n    \"0-1\": \"Name of the API (this is a required field)\",\n    \"1-1\": \"Brief description of the API for informational purposes\",\n    \"2-1\": \"The origin parameter specifies a URI that may access the resource.  The browser must enforce this.  For requests without credentials, the server may specify \\\"*\\\" as a wildcard, thereby allowing any origin to access the resource. \\n \\ne.g. **Access-Control-Allow-Origin: <origin> | * **\",\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"3-1\": \"Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. \\n \\ne.g. **Access-Control-Expose-Headers: X-My-Custom-Header, X-Another-Custom-Header**\",\n    \"4-1\": \"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.\",\n    \"5-1\": \"Used when issuing a preflight request to let the server know what HTTP headers will be used when the actual request is made.\\n \\ne.g.\\n**Access-Control-Request-Headers: <field-name>[, <field-name>]* **\",\n    \"6-1\": \"This header indicates how long the results of a preflight request can be cached.\\n \\ne.g.\\n**Access-Control-Max-Age: <delta-seconds>**\",\n    \"7-0\": \"Enable Swagger\",\n    \"7-1\": \"Indicates whether or not Swagger docs should be auto generated for this API.\"\n  },\n  \"cols\": 2,\n  \"rows\": 8\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {}\n  ]\n}\n[/block]","excerpt":"","slug":"apis","type":"basic","title":"APIs"}
The “Build” link on the nanoscale.io main home page will take you directly to the APIs view, which shows a list of existing APIs. [block:image] { "images": [ { "image": [ "https://files.readme.io/8EZXf9pKSuyMv1MDmF5X_apis.png", "apis.png", "1435", "541", "#5e8fc5", "" ] } ] } [/block] ## Creating a new API When creating a new API, you have the option to Import a file with pre-existing API definitions, such as the samples.json file that is referenced in your welcome email and available <a target="_blank" href="http://downloads.nanoscale.io/latest/samples.json">here</a>. From the APIs view, you can also Export, Edit and Delete existing APIs by hovering your cursor over the API row and selecting the corresponding Export, Edit, or Delete icon: [block:image] { "images": [ { "image": [ "https://files.readme.io/Nfy4NMLSX2qelVJWnQzQ_api-manip.png", "api-manip.png", "1342", "172", "#9e845b", "" ] } ] } [/block] ## Exporting an API Exporting an API will enable you to download a complete export of the API definition in a JSON file, including corresponding definitions for all Proxy Endpoints, Remote Endpoints, Environments, Hosts, Shared Libraries, and Groups. This capability is useful for sharing APIs with other developers, or migrating across nanoscale.io instances. ## Deleting an API You can delete an API and the corresponding sub components (Proxy Endpoints, Remote Endpoints, etc.). You will be prompted with a confirmation dialog when deleting an API. [block:callout] { "type": "info", "body": "Perform this operation with care; there is no undo. Export your API first as a backup, just in case.", "title": "Be careful!" } [/block] ## Editing an API To define or edit the sub-components of the API, such as Proxy Endpoints and Remote Endpoints, you can click on the API name and you will be taken to the next level of views, starting at the Proxy Endpoints view. To edit the properties of an API, hover over the API row and select the edit/pencil icon. This will take you to a view with additional API properties: [block:image] { "images": [ { "image": [ "https://files.readme.io/aJWChRfnT8WR6QTFrjNg_edit-api.png", "edit-api.png", "1435", "752", "#6282a6", "" ] } ] } [/block] ## API Properties [block:callout] { "type": "info", "body": "The following CORS related parameters are applied at the API level. Developer can control to enable/disable this at each endpoint level. For more details on these parameters, please <a target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS\">see</a>." } [/block] [block:parameters] { "data": { "0-0": "Name", "1-0": "Description", "2-0": "CORS allowed origin", "3-0": "CORS Allowed headers", "4-0": "CORS allow credentials", "5-0": "CORS request headers", "6-0": "CORS max age", "0-1": "Name of the API (this is a required field)", "1-1": "Brief description of the API for informational purposes", "2-1": "The origin parameter specifies a URI that may access the resource. The browser must enforce this. For requests without credentials, the server may specify \"*\" as a wildcard, thereby allowing any origin to access the resource. \n \ne.g. **Access-Control-Allow-Origin: <origin> | * **", "h-0": "Property", "h-1": "Description", "3-1": "Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. \n \ne.g. **Access-Control-Expose-Headers: X-My-Custom-Header, X-Another-Custom-Header**", "4-1": "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.", "5-1": "Used when issuing a preflight request to let the server know what HTTP headers will be used when the actual request is made.\n \ne.g.\n**Access-Control-Request-Headers: <field-name>[, <field-name>]* **", "6-1": "This header indicates how long the results of a preflight request can be cached.\n \ne.g.\n**Access-Control-Max-Age: <delta-seconds>**", "7-0": "Enable Swagger", "7-1": "Indicates whether or not Swagger docs should be auto generated for this API." }, "cols": 2, "rows": 8 } [/block] [block:image] { "images": [ {} ] } [/block]