Ragic Logo
<< Creating entries with custom HTML formsTable of ContentsModifying an Entry >>

Creating a New Entry

If you are not using simple HTML forms to create entries on Ragic, you will need to create API requests to create the entries. The endpoints for writing to a form is the same as reading them, but you issue a POST request instead of GET request.

What you need to do is use the field ids of the fields as name, and the values that you want to insert as parameter values.

Please note that your user will need write access to the form for this to work.

curl -F '800001=Dunder Mifflin' \

-F '800002=1-267-922-5599' \

-F '800003=Jim Halpert' \

-F '800007=Customer' \

-F 'api=' \

-H "Authorization:Basic YOUR_API_KEY_GOES_HERE" \

https://www.ragic.com/demo/sales/1

If the field is a multiple selection that can contain multiple values, you can have multiple parameters with the same field id as names. If the field is a date field the value will need to be in the format of yyyy/MM/dd or yyyy/MM/dd HH:mm:ss if there's a time part. So a request would look like this:

curl -F '800001=Dunder Mifflin' \

-F '800002=1-267-922-5599' \

-F '800003=Jim Halpert' \

-F '800007=Customer' \

-F '800007=Reseller' \

-F '800008=2018/12/25 23:30:00' \

-F 'api=' \

-H "Authorization:Basic YOUR_API_KEY_GOES_HERE" \

https://www.ragic.com/demo/sales/1

If you would like to insert data into the subtables at the same time, you will need a slightly different format for the fields in the subtables because Ragic needs a way to determine if the field values belong to the same entry in a subtable.

If the field values are in the same subtable row, assign them with the same negative row id with each other. It can be any negative integer. It's only a way to determine that they are in the same row.

1000014_-1=Bill

1000015_-1=Manager

1000016_-1=billg@microsoft.com

1000014_-2=Satya

1000015_-2=VP

1000016_-2=satyan@microsoft.com

The whole request would look like this:

curl -F '800001=Dunder Mifflin' \

-F '800002=1-267-922-5599' \

-F '800003=Jim Halpert' \

-F '800007=Customer' \

-F '800007=Reseller' \

-F '1000014_-1=Bill' \

-F '1000015_-1=Manager' \

-F '1000016_-1=billg@microsoft.com' \

-F '1000014_-2=Satya' \

-F '1000015_-2=VP' \

-F '1000016_-2=satyan@microsoft.com' \

-F 'api=' \

-H "Authorization:Basic YOUR_API_KEY_GOES_HERE" \

https://www.ragic.com/demo/sales/1

If you would like to populate a file upload field, just make sure that the request encoding type is a multipart/form-data. The HTML equivalent would be setting enctype='multipart/form-data'

With a multipart request, you can put the file in your request, and just put the file name as the field value.

1000088=test.jpg

Top of Page
<< Creating entries with custom HTML formsTable of ContentsModifying an Entry >>
Learn more about Ragic:
Why we created Ragic
Webinars
User Guide
Keep in touch:
Blog
Email
Facebook
Twitter
Ragic, Inc.
1-888-666-8037
Terms
Privacy