Confirm Registration

POST /node/api/users/:id/confirm/:token

Confirms a user's registration.

Request parameters

Path parameters

Parameter
Type
Description
id
String required
The ID of a user for which registration should be confirmed.
token
String
required
A token that a user receives after filling a registration form.

Body parameters

Parameter
Type
Description
password
String
required
A new user's password. If only confirmation is required, then the field should be set as null.

Response description

If your request is successful, the response body will contain the following message: "Activation successful."

Examples

Request examples

Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
user_id=<...>
5
token=<...>
6
url=https://$saymon_hostname/node/api/users/$user_id/confirm/$token
7
8
curl -X POST $url -u $login:$password \
9
-H "Content-Type: application/json" \
10
-d @- <<EOF
11
{
12
"password": null
13
}
14
EOF
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let userId = <...>
5
let token = <...>
6
let path = "/node/api/users/" + userId + "/confirm/" + token;
7
let auth = "Basic " + btoa(login + ":" + password);
8
9
let headers = new Headers();
10
headers.append("Content-Type", "application/json");
11
headers.append("Authorization", auth);
12
13
let data = JSON.stringify({
14
"password": null
15
});
16
17
let requestOptions = {
18
method: "POST",
19
headers: headers,
20
body: data
21
};
22
23
fetch(saymonHostname + path, requestOptions)
24
.then(response => response.text())
25
.then(result => console.log(result))
26
.catch(error => console.log("error", error));
Copied!
1
const http = require("http");
2
3
let login = <...>
4
let password = <...>
5
let saymonHostname = <...>
6
let userId = <...>
7
let token = <...>
8
let path = "/node/api/users/" + userId + "/confirm/" + token;
9
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
10
11
let options = {
12
"method": "POST",
13
"hostname": saymonHostname,
14
"headers": {
15
"Authorization": auth,
16
"Content-Type": "application/json"
17
},
18
"path": path
19
};
20
21
let req = http.request(options, function (res) {
22
let chunks = [];
23
24
res.on("data", function (chunk) {
25
chunks.push(chunk);
26
});
27
28
res.on("end", function (chunk) {
29
let body = Buffer.concat(chunks);
30
console.log(body.toString());
31
});
32
33
res.on("error", function (error) {
34
console.error(error);
35
});
36
});
37
38
let data = JSON.stringify({
39
password: null
40
});
41
42
req.write(data);
43
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
user_id = <...>
7
token = <...>
8
url = "https://" + saymon_hostname + "/node/api/users/" \
9
+ user_id + "/confirm/" + token;
10
11
body = {
12
"password": "null"
13
}
14
15
response = requests.request("POST", url, json=body, auth=(login, password))
16
print(response.text)
Copied!

Response example

1
"Activation successful."
Copied!
Last modified 1yr ago