Skip to content

Commit

Permalink
Merge pull request parse-community#355 from guich-wo/patch-1
Browse files Browse the repository at this point in the history
Document PUT /config support
  • Loading branch information
drew-gross committed Apr 22, 2016
2 parents 1889e55 + c987b67 commit 806952b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions en/rest/config.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,36 @@ The response body is a JSON object containing all the configuration parameters i
}
}
```

You can also update the config by sending a `PUT` request to config URL. Here is a simple example that will update the `Parse.Config`:

```bash
curl -X PUT \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-Master-Key: ${MASTER_KEY}" \
-d "{\"params\":{\"winningNumber\":43}}"
https://api.parse.com/1/config
```
```js
var request = require('request');
return request({
method: 'PUT',
url: Parse.serverURL + '/config',
headers: {
'X-Parse-Application-Id': Parse.applicationId,
'X-Parse-Master-Key': Parse.masterKey
},
json: true,
body: {
params: { winningNumber: 43 }
}
})
```

The response body is a JSON object containing a simple boolean value in the `result` field.

```json
{
"result": true
}
```

0 comments on commit 806952b

Please sign in to comment.