Skip to main content
PUT
/
api
/
v1
/
management
/
responses
/
{responseId}
Update Response
curl --request PUT \
  --url https://{baseurl}/api/v1/management/responses/{responseId} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "data": {
    "hs8yd14l9h8u353tjmv6rzawqqq": "clicked",
    "language": "en",
    "tcgls0063n8ri7dtrbnepcmz": "Who? Who? Who?",
    "ttc": {
      "hs8yd14l9h8u353tjmv6rzawqqq": 120,
      "tcgls0063n8ri7dtrbnepcmz": 190
    }
  },
  "finished": true
}
'
import requests

url = "https://{baseurl}/api/v1/management/responses/{responseId}"

payload = {
    "data": {
        "hs8yd14l9h8u353tjmv6rzawqqq": "clicked",
        "language": "en",
        "tcgls0063n8ri7dtrbnepcmz": "Who? Who? Who?",
        "ttc": {
            "hs8yd14l9h8u353tjmv6rzawqqq": 120,
            "tcgls0063n8ri7dtrbnepcmz": 190
        }
    },
    "finished": True
}
headers = {
    "x-api-key": "<x-api-key>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PUT',
  headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    data: {
      hs8yd14l9h8u353tjmv6rzawqqq: 'clicked',
      language: 'en',
      tcgls0063n8ri7dtrbnepcmz: 'Who? Who? Who?',
      ttc: {hs8yd14l9h8u353tjmv6rzawqqq: 120, tcgls0063n8ri7dtrbnepcmz: 190}
    },
    finished: true
  })
};

fetch('https://{baseurl}/api/v1/management/responses/{responseId}', 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://{baseurl}/api/v1/management/responses/{responseId}",
  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([
    'data' => [
        'hs8yd14l9h8u353tjmv6rzawqqq' => 'clicked',
        'language' => 'en',
        'tcgls0063n8ri7dtrbnepcmz' => 'Who? Who? Who?',
        'ttc' => [
                'hs8yd14l9h8u353tjmv6rzawqqq' => 120,
                'tcgls0063n8ri7dtrbnepcmz' => 190
        ]
    ],
    'finished' => true
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: <x-api-key>"
  ],
]);

$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://{baseurl}/api/v1/management/responses/{responseId}"

	payload := strings.NewReader("{\n  \"data\": {\n    \"hs8yd14l9h8u353tjmv6rzawqqq\": \"clicked\",\n    \"language\": \"en\",\n    \"tcgls0063n8ri7dtrbnepcmz\": \"Who? Who? Who?\",\n    \"ttc\": {\n      \"hs8yd14l9h8u353tjmv6rzawqqq\": 120,\n      \"tcgls0063n8ri7dtrbnepcmz\": 190\n    }\n  },\n  \"finished\": true\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("x-api-key", "<x-api-key>")
	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://{baseurl}/api/v1/management/responses/{responseId}")
  .header("x-api-key", "<x-api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"data\": {\n    \"hs8yd14l9h8u353tjmv6rzawqqq\": \"clicked\",\n    \"language\": \"en\",\n    \"tcgls0063n8ri7dtrbnepcmz\": \"Who? Who? Who?\",\n    \"ttc\": {\n      \"hs8yd14l9h8u353tjmv6rzawqqq\": 120,\n      \"tcgls0063n8ri7dtrbnepcmz\": 190\n    }\n  },\n  \"finished\": true\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://{baseurl}/api/v1/management/responses/{responseId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"data\": {\n    \"hs8yd14l9h8u353tjmv6rzawqqq\": \"clicked\",\n    \"language\": \"en\",\n    \"tcgls0063n8ri7dtrbnepcmz\": \"Who? Who? Who?\",\n    \"ttc\": {\n      \"hs8yd14l9h8u353tjmv6rzawqqq\": 120,\n      \"tcgls0063n8ri7dtrbnepcmz\": 190\n    }\n  },\n  \"finished\": true\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "createdAt": "2024-04-23T12:15:01.680Z",
    "data": {
      "hs8yd14l9h8u353tjmv6rzaw": "clicked",
      "hs8yd14l9h8u353tjmv6rzawqqq": "clicked",
      "tcgls0063n8ri7dtrbnepcmz": "Who? Who? Who?"
    },
    "finished": true,
    "id": "clvccml2p0009xz1zrlk1wbqb",
    "language": "en",
    "meta": {
      "action": "test action",
      "source": "Postman API",
      "url": "https://postman.com",
      "userAgent": {}
    },
    "person": {
      "attributes": {
        "Created From": "API",
        "created_from": "API"
      },
      "createdAt": "2024-04-23T07:39:22.696Z",
      "id": "clvc2s3ig000k494jltkqkm2u",
      "updatedAt": "2024-04-23T07:39:22.696Z",
      "userId": "THIS-IS-A-VVERY-LONG-USER-ID-FOR-TESTING",
      "workspaceId": "clurwouax000azffxt7n5unn3"
    },
    "personAttributes": {
      "Created From": "API",
      "created_from": "API"
    },
    "singleUseId": null,
    "surveyId": "clus3omb00009oo10s53e2pa5",
    "tags": [],
    "ttc": {
      "_total": 310,
      "hs8yd14l9h8u353tjmv6rzawqqq": 120,
      "tcgls0063n8ri7dtrbnepcmz": 190
    },
    "updatedAt": "2024-04-23T12:16:39.774Z"
  }
}
{
  "code": "unauthorized",
  "details": {},
  "message": "You are not authorized to access this resource"
}

Headers

x-api-key
string
required

Path Parameters

responseId
string
required

Body

application/json

The body is of type object.

Response

OK

The response is of type object.