Delete
curl --request DELETE \
--url https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>"
}
'import requests
url = "https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete"
payload = { "id": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>'})
};
fetch('https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete', 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}/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<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}/delete"
payload := strings.NewReader("{\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"body" {
"message": "Item deleted"
}
}
{
"statusCode": 400,
"body" {
err: {
"message": "The provided key element does not match the schema",
"code": "ValidationException",
"time": "2023-08-18T20:20:02.857Z",
"requestId": "K0I8M4RP3CAH2S9MM1PVGLG2GRVV4KQNSO5AEMVJF66Q9ASUAAJG",
"statusCode": 400,
"retryable": false,
"retryDelay": 37.399809106962046
},
compelete: false
}
}
DynamoDB API
Delete
Delete an entry from your DynamoDB table
DELETE
/
dynamodb
/
{YOUR_DB_NAME}
/
delete
Delete
curl --request DELETE \
--url https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>"
}
'import requests
url = "https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete"
payload = { "id": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>'})
};
fetch('https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete', 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}/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<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}/delete"
payload := strings.NewReader("{\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vdrdfvu2b3.execute-api.us-east-2.amazonaws.com/v3/dynamodb/{YOUR_DB_NAME}/delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"body" {
"message": "Item deleted"
}
}
{
"statusCode": 400,
"body" {
err: {
"message": "The provided key element does not match the schema",
"code": "ValidationException",
"time": "2023-08-18T20:20:02.857Z",
"requestId": "K0I8M4RP3CAH2S9MM1PVGLG2GRVV4KQNSO5AEMVJF66Q9ASUAAJG",
"statusCode": 400,
"retryable": false,
"retryDelay": 37.399809106962046
},
compelete: false
}
}
Path
string
required
The name of the DynamoDB you want to interact with.
Body
string
required
ID of the element you want to remove from the table
Response
number
Based off of standard HTTP request guidelines
object
Information regarding your delete request
{
"statusCode": 200,
"body" {
"message": "Item deleted"
}
}
{
"statusCode": 400,
"body" {
err: {
"message": "The provided key element does not match the schema",
"code": "ValidationException",
"time": "2023-08-18T20:20:02.857Z",
"requestId": "K0I8M4RP3CAH2S9MM1PVGLG2GRVV4KQNSO5AEMVJF66Q9ASUAAJG",
"statusCode": 400,
"retryable": false,
"retryDelay": 37.399809106962046
},
compelete: false
}
}
⌘I

