{"_id":"588f722cbcace50f0052ba34","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"},"__v":0,"parentDoc":null,"user":"565f3941ea46251700972783","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-16T20:47:16.484Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"environment\": {\n        \"api_id\": 95,\n        \"id\": 95,\n        \"name\": \"Staging\",\n        \"description\": \"staging\",\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":""}]},"settings":"","examples":{"codes":[{"language":"curl","code":"curl -b cookies.txt -c cookies.txt -H \"Content-Type: application/json\" -X PUT -d '{\"environment\":{\"name\":\"Staging\",\"description\":\"staging\",\"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/95"}]},"method":"put","auth":"required","params":[{"_id":"56c38dc0c39ff40d00d25f74","ref":"","in":"path","required":false,"desc":"The environment's id","default":"","type":"string","name":"id"}],"url":"/environments/:id"},"isReference":true,"order":24,"body":"Updates 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\": \"api_id\",\n    \"1-0\": \"id\",\n    \"2-0\": \"name\",\n    \"3-0\": \"description\",\n    \"4-0\": \"data\",\n    \"5-0\": \"session_name\",\n    \"6-0\": \"session_auth_key\",\n    \"7-0\": \"session_encryption_key\",\n    \"8-0\": \"session_auth_key_rotate\",\n    \"9-0\": \"session_encryption_key_rotate\",\n    \"10-0\": \"show_javascript_errors\",\n    \"0-1\": \"`number`\",\n    \"1-1\": \"`number`\",\n    \"10-1\": \"`boolean`\",\n    \"2-1\": \"`string`\",\n    \"3-1\": \"`string`\",\n    \"5-1\": \"`string`\",\n    \"6-1\": \"`string`\",\n    \"7-1\": \"`string`\",\n    \"8-1\": \"`string`\",\n    \"9-1\": \"`string`\",\n    \"4-1\": \"`object`\",\n    \"0-2\": \"The API identifier.\",\n    \"1-2\": \"The environment identifier.\",\n    \"2-2\": \"The name of the environment.\",\n    \"3-2\": \"The description of the environment.\",\n    \"4-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    \"5-2\": \"The name of the cookie used to store admin app sessions.\",\n    \"6-2\": \"An encryption key that is used for session authentication by the gorilla toolkit.\",\n    \"7-2\": \"An encryption key that is used to encrypt the contents of the session cookie.\",\n    \"8-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    \"9-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    \"10-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\": 11\n}\n[/block]\nHere is an example of the `JSON` used to update an environment:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"environment\\\": {\\n        \\\"name\\\": \\\"Staging\\\",\\n        \\\"description\\\": \\\"staging\\\",\\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        \\\"data\\\": {}\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"environmentsid-1","type":"endpoint","title":"/environments/:id"}

put/environments/:id


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
string
The environment's id

Examples


Result Format


Documentation

Updates 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": "api_id", "1-0": "id", "2-0": "name", "3-0": "description", "4-0": "data", "5-0": "session_name", "6-0": "session_auth_key", "7-0": "session_encryption_key", "8-0": "session_auth_key_rotate", "9-0": "session_encryption_key_rotate", "10-0": "show_javascript_errors", "0-1": "`number`", "1-1": "`number`", "10-1": "`boolean`", "2-1": "`string`", "3-1": "`string`", "5-1": "`string`", "6-1": "`string`", "7-1": "`string`", "8-1": "`string`", "9-1": "`string`", "4-1": "`object`", "0-2": "The API identifier.", "1-2": "The environment identifier.", "2-2": "The name of the environment.", "3-2": "The description of the environment.", "4-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).", "5-2": "The name of the cookie used to store admin app sessions.", "6-2": "An encryption key that is used for session authentication by the gorilla toolkit.", "7-2": "An encryption key that is used to encrypt the contents of the session cookie.", "8-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).", "9-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).", "10-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": 11 } [/block] Here is an example of the `JSON` used to update an environment: [block:code] { "codes": [ { "code": "{\n \"environment\": {\n \"name\": \"Staging\",\n \"description\": \"staging\",\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 \"data\": {}\n }\n}", "language": "json" } ] } [/block]