This page will help you get started with common API calls.
Creating a new Facebook data source
Create a new Facebook data source using the POST /datasources method
.
Note: In this instance, you need to find the oauth_user_token from your Facebook account.
curl https://app.klipfolio.com/api/1/datasources -X POST -d "{'name':'<datasource name>',
'description':'<datasource description>', 'connector':'facebook', 'format':'json',
'refresh_interval':14400,
'properties':{'endpoint_url':
'https:\/\/graph.facebook.com\/me', 'oauth_user_token':'<XXX>',
'oauth_provider_id':'facebook20'}}
" --header "kf-api-key:<apikey>" -H Content-Type:application/json
Uploading a file to an existing datasource
PUT data to upload a file to an existing datasource using --upload-file. This example is using JSON.
curl https://app.klipfolio.com/api/1/datasource-instances/0123456789abcdef0123456789abcdef/data -X PUT --upload-file revenue_date.json --header "kf-api-key:01234df230c488e9c5c18862a8967df5ab367c6e" -H Content-Type:application/json
Creating a data source using the REST/URL connector
Create a data source using our REST/URL connector that connects to any service, even if it is not listed as one of our Service Connectors.
curl https://app.klipfolio.com/api/1/datasources -X POST -d
{
"name": "TESTPostman POST Klipfolio API",
"description": "Post man test",
"connector": "simple_rest",
"format": "json",
"refresh_interval": 14400,
"properties": {
"endpoint_url": "https://yourUniqueEndpoint.com/api/values",
"method": "get",
"parameters": "[{\"name\":\"x-api- key\",\"value\":\"1aBCDefgHi2JkLmnOpqrs3TuvwX4yZAB5CdE67fg\",\"type\":\"header\"]",
}
}