Yes! You can insert data into a sheet in your Flatfile workspace using an API POST request.
In order to do this, you will need three things:
- A correct path to route the POST request.
- A valid API key.
- Correctly formatted JSON data
POST Request URL
To correctly route your POST request, you will need the workspace ID of the workspace that contains the sheet you are sending data to, and you will need the ID of the sheet you are working with. The post request URL will follow the format https://api.us.flatfile.io/workspace/{workspaceID}/sheet/{sheet}/data. For more information about this, you can view our REST API documentation.
JSON Data Formatting
You can see how your JSON data should be structured by clicking on Explore API in the sheet you are looking to populate.
In the Explore API expandable menu, you can enter data, see API access keys, and see helpful code examples. You can also see the way that data is structured in Flatfile.
All JSON data in Flatfile has the same basic structure. When the JSON contains data, it will look something like this:
{
"data": [
{
"internalId": "1",
"name": "Parent Company"
},
{
"internalId": "7",
"name": "Parent Company 2"
},
{
"internalId": "5",
"name": "Parent Company 3"
}
]
}
If you are importing data using an API, remember that the object containing the array of data must be called “data.”
Assuming your JSON is formatted correctly, you have the correct API key, and your POST URL is correct, you can upload data to a sheet using an API.
Comments
0 comments
Please sign in to leave a comment.