{"_id":"588f722cbcace50f0052ba33","__v":0,"user":"565f3941ea46251700972783","parentDoc":null,"project":"565f5fa26bafd40d0030a064","version":{"_id":"588f722bbcace50f0052b9e1","project":"565f5fa26bafd40d0030a064","__v":1,"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"},"category":{"_id":"588f722bbcace50f0052b9e6","__v":0,"project":"565f5fa26bafd40d0030a064","version":"588f722bbcace50f0052b9e1","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-25T18:09:36.891Z","from_sync":false,"order":4,"slug":"dashboard-api","title":"Dashboard API"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-17T00:04:23.508Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl -b cookies.txt -c cookies.txt -H \"Content-Type: application/json\" -X POST -d '{\"environment\":{\"name\":\"Production\",\"description\":\"production\",\"session_name\":\"\",\"session_auth_key\":\"\",\"session_encryption_key\":\"\",\"session_auth_key_rotate\":\"\",\"session_encryption_key_rotate\":\"\",\"show_javascript_errors\":false,\"data\":{}}}' https://api.nanoscale.io/apis/95/environments","language":"curl"}]},"method":"post","results":{"codes":[{"language":"json","code":"{\n    \"environment\": {\n        \"api_id\": 95,\n        \"id\": 99,\n        \"name\": \"Production\",\n        \"description\": \"production\",\n        \"data\": {},\n        \"session_name\": \"\",\n        \"session_auth_key\": \"\",\n        \"session_encryption_key\": \"\",\n        \"session_auth_key_rotate\": \"\",\n        \"session_encryption_key_rotate\": \"\",\n        \"show_javascript_errors\": false\n    }\n}","name":"","status":200}]},"settings":"","auth":"required","params":[],"url":"/environments"},"isReference":true,"order":23,"body":"Creates a single environment.\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\": \"name\",\n    \"1-0\": \"description\",\n    \"2-0\": \"session_name\",\n    \"3-0\": \"session_auth_key\",\n    \"4-0\": \"session_encryption_key\",\n    \"5-0\": \"session_auth_key_rotate\",\n    \"6-0\": \"session_encryption_key_rotate\",\n    \"7-0\": \"show_javascript_errors\",\n    \"8-0\": \"data\",\n    \"0-1\": \"`string`\",\n    \"1-1\": \"`string`\",\n    \"2-1\": \"`string`\",\n    \"3-1\": \"`string`\",\n    \"4-1\": \"`string`\",\n    \"5-1\": \"`string`\",\n    \"6-1\": \"`string`\",\n    \"7-1\": \"`boolean`\",\n    \"8-1\": \"`object`\",\n    \"0-2\": \"The name of the environment.\",\n    \"1-2\": \"The description of the environment.\",\n    \"8-2\": \"Environment specific data that pertains to the environment. These values would overwrite the values of a remote endpoint's 'data' (i.e. if you want to have a different URL in a specific environment for a remote endpoint than what is specified on the remote_endpoint itself).\",\n    \"2-2\": \"The name of the cookie used to store admin app sessions.\",\n    \"3-2\": \"An encryption key that is used for session authentication by the gorilla toolkit.\",\n    \"4-2\": \"An encryption key that is used to encrypt the contents of the session cookie.\",\n    \"5-2\": \"Used for 'key rotation' (i.e. to create a new session_auth_key, you need to store the old session_auth_key in session_auth_key_rotate so that you can authenticate the existing cookie that the user sends you before you begin using the new auth key).\",\n    \"6-2\": \"Used for 'key rotation'  (i.e. if you want to create a new session_encryption_key, you need to store the old session_encryption_key in session_encryption_key_rotate so that you can decrypt the existing cookie before you re-encrypt it with the new session_encryption_key).\",\n    \"7-2\": \"Indicates whether or not to return Javascript errors that occur within a proxy endpoint with the error response, or whether to suppress them for security purposes.\\n\\nTypically you would only want this turned on in a development environment.\"\n  },\n  \"cols\": 3,\n  \"rows\": 9\n}\n[/block]\nHere is an example of the `JSON` used to create an environment:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"environment\\\": {\\n        \\\"name\\\": \\\"Staging\\\",\\n        \\\"description\\\": \\\"staging\\\",\\n        \\\"session_name\\\": \\\"_staging_nanoscalesamples\\\",\\n        \\\"session_auth_key\\\": \\\"3442345345435w\\\",\\n        \\\"session_encryption_key\\\": null,\\n        \\\"session_auth_key_rotate\\\": null,\\n        \\\"session_encryption_key_rotate\\\": null,\\n        \\\"show_javascript_errors\\\": false,\\n        \\\"data\\\": {\\n        \\t\\\"mockEventsUrl\\\": \\\"https://mocks.nanoscaleapi.io/v1/events/\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"environments-2","type":"endpoint","title":"/environments"}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format


Documentation

Creates a single environment. Here is a list of fields that can be provided: [block:parameters] { "data": { "h-0": "key", "h-1": "type", "h-2": "description", "0-0": "name", "1-0": "description", "2-0": "session_name", "3-0": "session_auth_key", "4-0": "session_encryption_key", "5-0": "session_auth_key_rotate", "6-0": "session_encryption_key_rotate", "7-0": "show_javascript_errors", "8-0": "data", "0-1": "`string`", "1-1": "`string`", "2-1": "`string`", "3-1": "`string`", "4-1": "`string`", "5-1": "`string`", "6-1": "`string`", "7-1": "`boolean`", "8-1": "`object`", "0-2": "The name of the environment.", "1-2": "The description of the environment.", "8-2": "Environment specific data that pertains to the environment. These values would overwrite the values of a remote endpoint's 'data' (i.e. if you want to have a different URL in a specific environment for a remote endpoint than what is specified on the remote_endpoint itself).", "2-2": "The name of the cookie used to store admin app sessions.", "3-2": "An encryption key that is used for session authentication by the gorilla toolkit.", "4-2": "An encryption key that is used to encrypt the contents of the session cookie.", "5-2": "Used for 'key rotation' (i.e. to create a new session_auth_key, you need to store the old session_auth_key in session_auth_key_rotate so that you can authenticate the existing cookie that the user sends you before you begin using the new auth key).", "6-2": "Used for 'key rotation' (i.e. if you want to create a new session_encryption_key, you need to store the old session_encryption_key in session_encryption_key_rotate so that you can decrypt the existing cookie before you re-encrypt it with the new session_encryption_key).", "7-2": "Indicates whether or not to return Javascript errors that occur within a proxy endpoint with the error response, or whether to suppress them for security purposes.\n\nTypically you would only want this turned on in a development environment." }, "cols": 3, "rows": 9 } [/block] Here is an example of the `JSON` used to create an environment: [block:code] { "codes": [ { "code": "{\n \"environment\": {\n \"name\": \"Staging\",\n \"description\": \"staging\",\n \"session_name\": \"_staging_nanoscalesamples\",\n \"session_auth_key\": \"3442345345435w\",\n \"session_encryption_key\": null,\n \"session_auth_key_rotate\": null,\n \"session_encryption_key_rotate\": null,\n \"show_javascript_errors\": false,\n \"data\": {\n \t\"mockEventsUrl\": \"https://mocks.nanoscaleapi.io/v1/events/\"\n }\n }\n}", "language": "json" } ] } [/block]