Updating records

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsUpdating records
(Created page with "### Tutorial POST multiple records to a SQL or NoSQL database. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL....")
Line 11: Line 11:
 
[[File:Swagger-post-records.png|1000px]]
 
[[File:Swagger-post-records.png|1000px]]
  
### Example - Post multiple contact records
+
### Example - PUT (update) multiple contact records
  
 
* Table name: contact
 
* Table name: contact
Line 17: Line 17:
 
  "resource": [
 
  "resource": [
 
   {
 
   {
 +
    "id": 107,
 
     "first_name": "Alice",
 
     "first_name": "Alice",
 
     "last_name": "Jones"
 
     "last_name": "Jones"
 
   },
 
   },
 
   {
 
   {
 +
    "id": 108,
 
     "first_name": "Bob",
 
     "first_name": "Bob",
 
     "last_name": "Simpson"
 
     "last_name": "Simpson"

Revision as of 17:13, 15 October 2015

      1. Tutorial

POST multiple records to a SQL or NoSQL database. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL.

      1. API Endpoint
POST https://{url}/api/v2/{api_name}/_table/{table_name}
      1. API Docs Screenshot

Swagger-post-records.png

      1. Example - PUT (update) multiple contact records
  • Table name: contact
  • Body parameter in API call:
    {
"resource": [ { "id": 107, "first_name": "Alice", "last_name": "Jones" }, { "id": 108, "first_name": "Bob", "last_name": "Simpson" } ] }
  • Request URL:
    https://foo.com/api/v2/db/_table/contact