Create or update the user engagement status on any challenge's action
curl --request PUT \
--url https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement \
--header 'Content-Type: application/json' \
--data '
{
"status": "ENGAGED",
"disengagementDate": "2023-12-31",
"actions": [
{
"actionId": "HEATING_DROP_2C"
}
],
"beginDate": "2024-01-01",
"endDate": "2024-01-01"
}
'import requests
url = "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement"
payload = {
"status": "ENGAGED",
"disengagementDate": "2023-12-31",
"actions": [{ "actionId": "HEATING_DROP_2C" }],
"beginDate": "2024-01-01",
"endDate": "2024-01-01"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
status: 'ENGAGED',
disengagementDate: '2023-12-31',
actions: [{actionId: 'HEATING_DROP_2C'}],
beginDate: '2024-01-01',
endDate: '2024-01-01'
})
};
fetch('https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'ENGAGED',
'disengagementDate' => '2023-12-31',
'actions' => [
[
'actionId' => 'HEATING_DROP_2C'
]
],
'beginDate' => '2024-01-01',
'endDate' => '2024-01-01'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement"
payload := strings.NewReader("{\n \"status\": \"ENGAGED\",\n \"disengagementDate\": \"2023-12-31\",\n \"actions\": [\n {\n \"actionId\": \"HEATING_DROP_2C\"\n }\n ],\n \"beginDate\": \"2024-01-01\",\n \"endDate\": \"2024-01-01\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"ENGAGED\",\n \"disengagementDate\": \"2023-12-31\",\n \"actions\": [\n {\n \"actionId\": \"HEATING_DROP_2C\"\n }\n ],\n \"beginDate\": \"2024-01-01\",\n \"endDate\": \"2024-01-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"ENGAGED\",\n \"disengagementDate\": \"2023-12-31\",\n \"actions\": [\n {\n \"actionId\": \"HEATING_DROP_2C\"\n }\n ],\n \"beginDate\": \"2024-01-01\",\n \"endDate\": \"2024-01-01\"\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"type": {},
"status": 123,
"title": "<string>",
"detail": "<string>",
"instance": {},
"properties": {}
}{
"type": {},
"status": 123,
"title": "<string>",
"detail": "<string>",
"instance": {},
"properties": {}
}Challenge's engagement
Create or update the user engagement status on any challenge's action
An engagement refers to the active participation of a user in a given challenge.
This API allows to create and update the list of engaged or already done actions.
Updating an action engagement doesn’t change the engagement date.
PUT
/
sites
/
{site-id}
/
challenges
/
{challenge-id}
/
engagement
Create or update the user engagement status on any challenge's action
curl --request PUT \
--url https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement \
--header 'Content-Type: application/json' \
--data '
{
"status": "ENGAGED",
"disengagementDate": "2023-12-31",
"actions": [
{
"actionId": "HEATING_DROP_2C"
}
],
"beginDate": "2024-01-01",
"endDate": "2024-01-01"
}
'import requests
url = "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement"
payload = {
"status": "ENGAGED",
"disengagementDate": "2023-12-31",
"actions": [{ "actionId": "HEATING_DROP_2C" }],
"beginDate": "2024-01-01",
"endDate": "2024-01-01"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
status: 'ENGAGED',
disengagementDate: '2023-12-31',
actions: [{actionId: 'HEATING_DROP_2C'}],
beginDate: '2024-01-01',
endDate: '2024-01-01'
})
};
fetch('https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'ENGAGED',
'disengagementDate' => '2023-12-31',
'actions' => [
[
'actionId' => 'HEATING_DROP_2C'
]
],
'beginDate' => '2024-01-01',
'endDate' => '2024-01-01'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement"
payload := strings.NewReader("{\n \"status\": \"ENGAGED\",\n \"disengagementDate\": \"2023-12-31\",\n \"actions\": [\n {\n \"actionId\": \"HEATING_DROP_2C\"\n }\n ],\n \"beginDate\": \"2024-01-01\",\n \"endDate\": \"2024-01-01\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"ENGAGED\",\n \"disengagementDate\": \"2023-12-31\",\n \"actions\": [\n {\n \"actionId\": \"HEATING_DROP_2C\"\n }\n ],\n \"beginDate\": \"2024-01-01\",\n \"endDate\": \"2024-01-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges/{challenge-id}/engagement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"ENGAGED\",\n \"disengagementDate\": \"2023-12-31\",\n \"actions\": [\n {\n \"actionId\": \"HEATING_DROP_2C\"\n }\n ],\n \"beginDate\": \"2024-01-01\",\n \"endDate\": \"2024-01-01\"\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"type": {},
"status": 123,
"title": "<string>",
"detail": "<string>",
"instance": {},
"properties": {}
}{
"type": {},
"status": 123,
"title": "<string>",
"detail": "<string>",
"instance": {},
"properties": {}
}Path Parameters
The site identifier
The challenge identifier
Body
application/json
The engagement status
Available options:
ENGAGED, REMOVED_CONSENT, MANUALLY_DISENGAGED Example:
"ENGAGED"
The disengagement date, format YYYY-MM-DD
Example:
"2023-12-31"
Show child attributes
Show child attributes
The engagement begin date, format YYYY-MM-DD
Example:
"2024-01-01"
The engagement end date, format YYYY-MM-DD
Example:
"2024-01-01"
Response
OK, No Content