Update
curl --request PUT \
--url https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"name": "<string>"
}
'import requests
url = "https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update"
payload = {
"id": "<string>",
"name": "<string>"
}
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({id: '<string>', name: '<string>'})
};
fetch('https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update', 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://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update",
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([
'id' => '<string>',
'name' => '<string>'
]),
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://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\"\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://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update")
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 \"id\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"body" {
"message": "Item updated"
}
}
{
"statusCode": 400,
"body" {
err: {
"message": "The provided key element does not match the schema",
"code": "ValidationException",
"time": "2023-08-18T20:21:13.322Z",
"requestId": "P1SOGBUGG06C1HKF2U2GIUR8I7VV4KQNSO5AEMVJF66Q9ASUAAJG",
"statusCode": 400,
"retryable": false,
"retryDelay": 26.247972152830666
},
compelete: false
}
}
DynamoDB API
Update
Update an entry in your DynamoDB table
PUT
/
dynamodb
/
{YOUR_DB_NAME}
/
update
Update
curl --request PUT \
--url https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"name": "<string>"
}
'import requests
url = "https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update"
payload = {
"id": "<string>",
"name": "<string>"
}
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({id: '<string>', name: '<string>'})
};
fetch('https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update', 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://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update",
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([
'id' => '<string>',
'name' => '<string>'
]),
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://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\"\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://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/update")
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 \"id\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"body" {
"message": "Item updated"
}
}
{
"statusCode": 400,
"body" {
err: {
"message": "The provided key element does not match the schema",
"code": "ValidationException",
"time": "2023-08-18T20:21:13.322Z",
"requestId": "P1SOGBUGG06C1HKF2U2GIUR8I7VV4KQNSO5AEMVJF66Q9ASUAAJG",
"statusCode": 400,
"retryable": false,
"retryDelay": 26.247972152830666
},
compelete: false
}
}
Path
string
required
The name of the DynamoDB you want to interact with.
Body
string
required
The ID of the entry you want to change
string
required
What you want to change the entry to
Response
number
Based off of standard HTTP request guidelines
object
Information regarding your update request
{
"statusCode": 200,
"body" {
"message": "Item updated"
}
}
{
"statusCode": 400,
"body" {
err: {
"message": "The provided key element does not match the schema",
"code": "ValidationException",
"time": "2023-08-18T20:21:13.322Z",
"requestId": "P1SOGBUGG06C1HKF2U2GIUR8I7VV4KQNSO5AEMVJF66Q9ASUAAJG",
"statusCode": 400,
"retryable": false,
"retryDelay": 26.247972152830666
},
compelete: false
}
}
⌘I

