Posting a single record

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsPosting a single record
(Created page with "The writer's name is Donald Goudy. My family stays in Guam yet my spouse desires us to relocate. To climb is the only pastime her other half does not approve of. Interviewi...")
 
m (Changed from markdown to mediawiki formatting)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
The writer's name is Donald Goudy.  My family stays in Guam yet my spouse desires us to relocate. To climb is the only pastime her other half does not approve of. Interviewing has been her day job for some time but she intends on changing it.  See exactly what's new on my site here: http://4jrz077.tumblr.com<br><br>Also visit my weblog ... [http://4jrz077.tumblr.com http://4jrz077.tumblr.com/]
+
== Tutorial ==
 +
 
 +
POST a single record by ID 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.
 +
 
 +
=== API Endpoint ===
 +
 
 +
<pre>POST https://{url}/api/v2/{api_name}/_table/{table_name}/{id}</pre>
 +
 
 +
=== API Docs Screenshot ===
 +
 
 +
[[File:Swagger-post-record.png|1000px]]
 +
 
 +
=== Example - POST a single contact record with ID 106 ===
 +
 
 +
* Table name: contact
 +
* ID parameter is API call:
 +
<pre>106</pre>
 +
* Body parameter in API call:
 +
<source lang="JavaScript">
 +
{
 +
    "resource": [
 +
        {
 +
            "first_name": "Alice",
 +
            "last_name": "Jones"
 +
        }
 +
    ]
 +
}
 +
</source>
 +
* Request URL:
 +
<pre>https://foo.com/api/v2/db/_table/contact/1</pre>

Latest revision as of 22:58, 5 May 2016

Tutorial

POST a single record by ID 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.

API Endpoint

POST https://{url}/api/v2/{api_name}/_table/{table_name}/{id}

API Docs Screenshot

Swagger-post-record.png

Example - POST a single contact record with ID 106

  • Table name: contact
  • ID parameter is API call:
106
  • Body parameter in API call:
{
    "resource": [
        {
            "first_name": "Alice",
            "last_name": "Jones"
        }
    ]
}
  • Request URL:
https://foo.com/api/v2/db/_table/contact/1