Create a Source
POST https://api.chartmogul.com/v1/data_sources
Creates a data_source object for importing data into ChartMogul.
curl -X POST "https://api.chartmogul.com/v1/data_sources" \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"name": "In-house billing"
}'
ChartMogul::DataSource.create!(name: "In-house billing")
ChartMogul.DataSource.create(config, {
name: "In-house billing",
});
ChartMogul\DataSource::create([
"name" => "In-house billing"
]);
api.CreateDataSource("In-house billing")
chartmogul.DataSource.create(config, data={"name": "In-house billing"})
{
"uuid": "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
"name": "In-house billing",
"system": "Custom",
"created_at": "2023-01-10T15:34:05.918Z",
"status": "idle"
}
#<ChartMogul::DataSource:0x007ff9f127d628
@uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
@name="In-house billing",
@system="Custom",
@created_at=2023-01-10 15:34:05 UTC,
@status="idle",
>
{
uuid: "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
name: "In-house billing",
system: "Custom",
created_at: "2023-01-10T15:34:05.918Z",
status: "idle"
}
ChartMogul\DataSource::__set_state(array(
"uuid" => "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
"name" => "In-house billing",
"system" => "Custom",
"created_at" => "2023-01-10T15:34:05.585Z",
"status" => "idle",
));
(*chartmogul.DataSource)(0xc042048380)({
UUID: (string) (len=39) "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
Name: (string) (len=16) "In-house billing",
System: (string) (len=10) "Custom",
CreatedAt: (string) (len=24) "2023-01-10T15:34:05.346Z",
Status: (string) (len=4) "idle",
})
<DataSource{
uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
name="In-house billing",
system="Custom",
created_at=datetime.datetime(2023, 1, 10, 15, 34, 5, 513000, tzinfo=datetime.timezone.utc),
status="idle",
}>
Body parameters
namestring required- A unique name for this source of customer billing data. For example,
In-house billingorLeads.
Response
The response object contains the following data:
uuid- The generated ChartMogul UUID for the created source.
name- The name of the source, as specified.
system- The system type. This is always
Custom, since this endpoint only creates custom endpoints. The key exists to be consistent with the "Retrieving a Source" endpoint. created_at- The time when this source was created in ChartMogul.
status- The current data import status. Since the source created using the endpoint is always of type
Custom, and the source has just been created, this will beidle. If data is currently being processed, then this would beworking. See the "Retrieving a Source" endpoint for values for other types of sources.
Creating sources for integrations. To create a source for one or more integrations maintained by ChartMogul, such as Stripe, Braintree, Recurly or PayPal, use the ChartMogul UI. To do so, go to Settings & Data > Sources and click ADD SOURCE.