Update View
Update an existing view by its name.
curl -X PUT "https://api.datafiniti.co/v4/views/John Doe" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"name": "John Doe",
"fields": [
"example_string"
]
}'
import requests
import json
url = "https://api.datafiniti.co/v4/views/John Doe"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"name": "John Doe",
"fields": [
"example_string"
]
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.datafiniti.co/v4/views/John Doe", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"name": "John Doe",
"fields": [
"example_string"
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"name": "John Doe",
"fields": [
"example_string"
]
}`)
req, err := http.NewRequest("PUT", "https://api.datafiniti.co/v4/views/John Doe", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.datafiniti.co/v4/views/John Doe')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"name": "John Doe",
"fields": [
"example_string"
]
}'
response = http.request(request)
puts response.body
{
"name": "John Doe",
"fields": [
"example_string"
],
"created_at": "2024-12-25T10:00:00Z"
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
/views/{view_name}Target server for requests. Edit to use your own host.
Bearer token obtained from the /auth endpoint. Include in requests as: Authorization: Bearer <token>
The name of the view to update
The media type of the request body
Name for the view
List of fields to include in the view
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Bearer token obtained from the /auth endpoint. Include in requests as: Authorization: Bearer <token>
Path Parameters
The name of the view to update
Responses
View name
Fields included in this view
Timestamp when the view was created
Error message describing what went wrong
Nobody's perfect, and you may find a view you created isn't quite right for your project. Not to worry, you can always update your views.