Important: This API has been deprecated. For more information, see the new Klipfolio API reference guide.
The data source API lets you update an existing data source over HTTPs using a RESTful URL. Each time you set up a data source, Klipfolio will provide you with a resource URL that you can use to set up automatic updates.
The resource URL is the location of the data source in the cloud so that Klipfolio can readily access that data source, allowing you to update Klips.
By going to a data sources library page, you will be able to find its resource URL, as well as see an example of the API in action. The default example shows how you would use a Unix command called ‘curl’ to upload data to that resource.
Example: curl —user username:password —form file=@local_file.txt https://app.klipfolio.com/api/1.0/datasource/6e59a3eb5d72ff7t3357f4871da8cbb2/data
Pushing your data source into Klipfolio can happen a number of ways, depending on what operating system, and programming language or tools you have at your disposal. Klipfolio has a RESTful API that users can POST data to. Each datasource is represented with a URL such as https://app.klipfolio.com/api/1.0/datasource/your-unique-data-source-ID/data
A common and proven method to POST data to Klipfolio is by using Curl on a Linux or Unix machine. For example:
curl --user username:password --form file=@local_file.txthttps://app.klipfolio.com/api/1.0/datasource/ your-unique-data-source-ID/data Curl is genrally installed by default on Linux or Unix machines, but can be downloaded and installed separately as well. See http://en.wikipedia.org/wiki/CURL
Similar techniques can be accomplished using various other programming languages on other platforms as well, such as PHP or Java.
Keep in mind that once the POST command has been successfully executed, this now has to be automated. Automating this command can map to a variety of scenarios. Every X number of minutes is a common way to automate this, but it could also be triggered based on a task finishing, or some other event. This is up to the developer to determine, and is generally accomplished using cron jobs. See http://en.wikipedia.org/wiki/Cron.
As of Release 27.1, there are restrictions on accessing data sources from accounts other than the owner. If you are using this API to refresh data sources for which you are not the owner (for example, if you are a partner refreshing a client's data source), a POST to this API will no longer function. Instead, use the new beta API (contact Klipfolio support for access) to PUT an data source update, for example:
Note the new beta API uses the /datasources resource instead of /datasource.
In an upcoming release, we are implementing roles and permissions for this beta API, which will control data source access including partner access to client account resources. When the beta API is updated to handle roles and permissions, this PUT request must be updated accordingly.
- How do I use Google Docs as my data source?
- How do I use Facebook Insights as my data source?
- How do I use Google Analytics as my data source?
Did you have trouble with the material in this article?
These articles may help: