Skip to content

buildin_endpoints_put_globals_name

Marcel Kloubert edited this page Feb 19, 2017 · 3 revisions

Home >> Build-in endpoints >> [PUT] /api/globals/{name}

[PUT] /api/globals/{name}

Saves a value.

canWrite property must be set to (true) for an user or guest in the settings to access the endpoint.

Example

Request:

PUT /api/globals/myVar

"The new value"

Possible response:

Content-type: application/json; charset=utf-8
Content-encoding: gzip
X-Vscode-Restapi: 1.0.0
Date: Fri, 10 Feb 2017 15:06:36 GMT
Connection: keep-alive
Transfer-Encoding: chunked

{
    "code": 0,
    "data": {
        "isNew": false,
        "old": "The old value",
        "new": "The new value"
    }
}

Other responses

Code Description
403 User has no right to save values.
Clone this wiki locally