Traverzer
  • About
  • Basics
    • Insert & Update
    • Fetch & Find
    • Delete
  • Reference
    • PUT
    • POST
    • DELETE
Powered by GitBook
On this page
Edit on GitHub
  1. Reference

PUT

The PUT method on the root of the domain will insert or update the record(s).

PUT https://api.traverzer.tech/

Headers

Name
Value

Content-Type

application/json

Authorization

<token>

Body

Name
Type
Description

[Table Name]

string

Name of the table

[Table Name].[Field Name]

string

Value of the field

Request

fetch('https://api.traverzer.tech/', { 
    method: 'PUT', 
    headers: { 
        'Content-Type': 'application/json',
        'Authorization': <token>
    }, 
    body: JSON.stringify({ 
        user: { 
            username: "johndoe", 
            email: "johndoe@example.com", 
            profile: { 
                name: "John Doe", 
                address: { 
                    street: "123 Main St", 
                    city: "Somewhere", 
                    state: "CA", 
                    postalCode: "90210", 
                    country: "USA" 
                }, 
            } 
        } 
    }) 
});

Response

{ 
    "user": { 
        "tvzr_key": "s9eujs0l",
        "username": "johndoe", 
        "email": "johndoe@example.com", 
        "profile": { 
            "tvzr_key": "29d8d7u7",
            "name": "John Doe", 
            "address": { 
                "tvzr_key": "sis28ds",
                "street": "123 Main St", 
                "city": "Somewhere", 
                "state": "CA", 
                "postalCode": "90210", 
                "country": "USA" 
            }, 
        } 
    } 
}
{
  "error": "Invalid request"
}
{
  "error": "Not found"
}
{
  "error": "Server error"
}

Last updated 4 months ago