curl --request POST \
--url https://data.us.algolia.com/1/sources/validate \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
--data '
{
"type": "algoliaIndex",
"name": "lorem",
"input": {
"storeKeys": [
"lorem"
],
"locales": [
"fr-FR"
],
"url": "lorem",
"projectKey": "lorem",
"fallbackIsInStockValue": true,
"productQueryPredicate": "lorem",
"useImagesObjects": true,
"customFields": {
"inventory": [
"lorem"
],
"price": [
"lorem"
],
"category": [
"lorem"
]
}
},
"authenticationID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f"
}
'// Initialize the client
var client = new IngestionClient(
new IngestionConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
);
// Call the API
var response = await client.ValidateSourceAsync(
new SourceCreate
{
Type = Enum.Parse<SourceType>("Commercetools"),
Name = "sourceName",
Input = new SourceInput(
new SourceCommercetools
{
StoreKeys = new List<string> { "myStore" },
Locales = new List<string> { "de" },
Url = "http://commercetools.com",
ProjectKey = "keyID",
}
),
AuthenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
}
);
// print the response
Console.WriteLine(response);// Initialize the client
final client = IngestionClient(
appId: 'ALGOLIA_APPLICATION_ID',
apiKey: 'ALGOLIA_API_KEY',
region: 'ALGOLIA_APPLICATION_REGION');
// Call the API
final response = await client.validateSource(
sourceCreate: SourceCreate(
type: SourceType.fromJson("commercetools"),
name: "sourceName",
input: SourceCommercetools(
storeKeys: [
"myStore",
],
locales: [
"de",
],
url: "http://commercetools.com",
projectKey: "keyID",
),
authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
),
);
// print the response
print(response);// Initialize the client with your application region, eg. ingestion.ALGOLIA_APPLICATION_REGION
client, err := ingestion.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", ingestion.US)
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}
// Call the API
response, err := client.ValidateSource(client.NewApiValidateSourceRequest().WithSourceCreate(
ingestion.NewEmptySourceCreate().
SetType(ingestion.SourceType("commercetools")).
SetName("sourceName").
SetInput(ingestion.SourceCommercetoolsAsSourceInput(
ingestion.NewEmptySourceCommercetools().SetStoreKeys(
[]string{"myStore"}).SetLocales(
[]string{
"de",
}).
SetUrl("http://commercetools.com").SetProjectKey("keyID"))).
SetAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f"),
),
)
if err != nil {
// handle the eventual error
panic(err)
}
// print the response
print(response)// Initialize the client
IngestionClient client = new IngestionClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION");
// Call the API
WatchResponse response = client.validateSource(
new SourceCreate()
.setType(SourceType.COMMERCETOOLS)
.setName("sourceName")
.setInput(
new SourceCommercetools()
.setStoreKeys(Arrays.asList("myStore"))
.setLocales(Arrays.asList("de"))
.setUrl("http://commercetools.com")
.setProjectKey("keyID")
)
.setAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f")
);
// print the response
System.out.println(response);// Initialize the client
// Replace 'us' with your Algolia Application Region
const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY').initIngestion({ region: 'us' });
// Call the API
const response = await client.validateSource({
type: 'commercetools',
name: 'sourceName',
input: { storeKeys: ['myStore'], locales: ['de'], url: 'http://commercetools.com', projectKey: 'keyID' },
authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',
});
// print the response
console.log(response);// Initialize the client
val client =
IngestionClient(
appId = "ALGOLIA_APPLICATION_ID",
apiKey = "ALGOLIA_API_KEY",
region = "ALGOLIA_APPLICATION_REGION",
)
// Call the API
var response =
client.validateSource(
sourceCreate =
SourceCreate(
type = SourceType.entries.first { it.value == "commercetools" },
name = "sourceName",
input =
SourceCommercetools(
storeKeys = listOf("myStore"),
locales = listOf("de"),
url = "http://commercetools.com",
projectKey = "keyID",
),
authenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
)
)
// print the response
println(response)// Initialize the client
$client = IngestionClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION');
// Call the API
$response = $client->validateSource(
['type' => 'commercetools',
'name' => 'sourceName',
'input' => ['storeKeys' => [
'myStore',
],
'locales' => [
'de',
],
'url' => 'http://commercetools.com',
'projectKey' => 'keyID',
],
'authenticationID' => '6c02aeb1-775e-418e-870b-1faccd4b2c0f',
],
);
// print the response
var_dump($response);# Initialize the client
# In an asynchronous context, you can use IngestionClient instead, which exposes the exact same methods.
client = IngestionClientSync(
"ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
)
# Call the API
response = client.validate_source(
source_create={
"type": "commercetools",
"name": "sourceName",
"input": {
"storeKeys": [
"myStore",
],
"locales": [
"de",
],
"url": "http://commercetools.com",
"projectKey": "keyID",
},
"authenticationID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
},
)
# print the response
print(response)# Initialize the client
client = Algolia::IngestionClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
# Call the API
response = client.validate_source(
Algolia::Ingestion::SourceCreate.new(
type: "commercetools",
name: "sourceName",
input: Algolia::Ingestion::SourceCommercetools.new(
store_keys: ["myStore"],
locales: ["de"],
url: "http://commercetools.com",
project_key: "keyID"
),
authentication_id: "6c02aeb1-775e-418e-870b-1faccd4b2c0f"
)
)
# print the response
puts(response)// Initialize the client
val client = IngestionClient(
appId = "ALGOLIA_APPLICATION_ID",
apiKey = "ALGOLIA_API_KEY",
region = "ALGOLIA_APPLICATION_REGION"
)
// Call the API
val response = Await.result(
client.validateSource(
sourceCreate = Some(
SourceCreate(
`type` = SourceType.withName("commercetools"),
name = "sourceName",
input = Some(
SourceCommercetools(
storeKeys = Some(Seq("myStore")),
locales = Some(Seq("de")),
url = "http://commercetools.com",
projectKey = "keyID"
)
),
authenticationID = Some("6c02aeb1-775e-418e-870b-1faccd4b2c0f")
)
)
),
Duration(100, "sec")
)
// print the response
println(response)// Initialize the client
let client = try IngestionClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY", region: .us)
// Call the API
let response = try await client.validateSource(sourceCreate: SourceCreate(
type: SourceType.commercetools,
name: "sourceName",
input: SourceInput.sourceCommercetools(SourceCommercetools(
storeKeys: ["myStore"],
locales: ["de"],
url: "http://commercetools.com",
projectKey: "keyID"
)),
authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f"
))
// print the response
print(response){
"runID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
"createdAt": "<string>",
"data": [
{}
],
"eventID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
"events": [
{
"batchSize": 10,
"eventID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
"publishedAt": "<string>",
"runID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
"data": {}
}
],
"message": "<string>"
}{
"message": "Invalid Application-Id or API-Key"
}Validate a source payload
Validates a source payload to ensure it can be created and that the data source can be reached by Algolia.
curl --request POST \
--url https://data.us.algolia.com/1/sources/validate \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
--data '
{
"type": "algoliaIndex",
"name": "lorem",
"input": {
"storeKeys": [
"lorem"
],
"locales": [
"fr-FR"
],
"url": "lorem",
"projectKey": "lorem",
"fallbackIsInStockValue": true,
"productQueryPredicate": "lorem",
"useImagesObjects": true,
"customFields": {
"inventory": [
"lorem"
],
"price": [
"lorem"
],
"category": [
"lorem"
]
}
},
"authenticationID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f"
}
'// Initialize the client
var client = new IngestionClient(
new IngestionConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
);
// Call the API
var response = await client.ValidateSourceAsync(
new SourceCreate
{
Type = Enum.Parse<SourceType>("Commercetools"),
Name = "sourceName",
Input = new SourceInput(
new SourceCommercetools
{
StoreKeys = new List<string> { "myStore" },
Locales = new List<string> { "de" },
Url = "http://commercetools.com",
ProjectKey = "keyID",
}
),
AuthenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
}
);
// print the response
Console.WriteLine(response);// Initialize the client
final client = IngestionClient(
appId: 'ALGOLIA_APPLICATION_ID',
apiKey: 'ALGOLIA_API_KEY',
region: 'ALGOLIA_APPLICATION_REGION');
// Call the API
final response = await client.validateSource(
sourceCreate: SourceCreate(
type: SourceType.fromJson("commercetools"),
name: "sourceName",
input: SourceCommercetools(
storeKeys: [
"myStore",
],
locales: [
"de",
],
url: "http://commercetools.com",
projectKey: "keyID",
),
authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
),
);
// print the response
print(response);// Initialize the client with your application region, eg. ingestion.ALGOLIA_APPLICATION_REGION
client, err := ingestion.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", ingestion.US)
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}
// Call the API
response, err := client.ValidateSource(client.NewApiValidateSourceRequest().WithSourceCreate(
ingestion.NewEmptySourceCreate().
SetType(ingestion.SourceType("commercetools")).
SetName("sourceName").
SetInput(ingestion.SourceCommercetoolsAsSourceInput(
ingestion.NewEmptySourceCommercetools().SetStoreKeys(
[]string{"myStore"}).SetLocales(
[]string{
"de",
}).
SetUrl("http://commercetools.com").SetProjectKey("keyID"))).
SetAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f"),
),
)
if err != nil {
// handle the eventual error
panic(err)
}
// print the response
print(response)// Initialize the client
IngestionClient client = new IngestionClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION");
// Call the API
WatchResponse response = client.validateSource(
new SourceCreate()
.setType(SourceType.COMMERCETOOLS)
.setName("sourceName")
.setInput(
new SourceCommercetools()
.setStoreKeys(Arrays.asList("myStore"))
.setLocales(Arrays.asList("de"))
.setUrl("http://commercetools.com")
.setProjectKey("keyID")
)
.setAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f")
);
// print the response
System.out.println(response);// Initialize the client
// Replace 'us' with your Algolia Application Region
const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY').initIngestion({ region: 'us' });
// Call the API
const response = await client.validateSource({
type: 'commercetools',
name: 'sourceName',
input: { storeKeys: ['myStore'], locales: ['de'], url: 'http://commercetools.com', projectKey: 'keyID' },
authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',
});
// print the response
console.log(response);// Initialize the client
val client =
IngestionClient(
appId = "ALGOLIA_APPLICATION_ID",
apiKey = "ALGOLIA_API_KEY",
region = "ALGOLIA_APPLICATION_REGION",
)
// Call the API
var response =
client.validateSource(
sourceCreate =
SourceCreate(
type = SourceType.entries.first { it.value == "commercetools" },
name = "sourceName",
input =
SourceCommercetools(
storeKeys = listOf("myStore"),
locales = listOf("de"),
url = "http://commercetools.com",
projectKey = "keyID",
),
authenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
)
)
// print the response
println(response)// Initialize the client
$client = IngestionClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION');
// Call the API
$response = $client->validateSource(
['type' => 'commercetools',
'name' => 'sourceName',
'input' => ['storeKeys' => [
'myStore',
],
'locales' => [
'de',
],
'url' => 'http://commercetools.com',
'projectKey' => 'keyID',
],
'authenticationID' => '6c02aeb1-775e-418e-870b-1faccd4b2c0f',
],
);
// print the response
var_dump($response);# Initialize the client
# In an asynchronous context, you can use IngestionClient instead, which exposes the exact same methods.
client = IngestionClientSync(
"ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
)
# Call the API
response = client.validate_source(
source_create={
"type": "commercetools",
"name": "sourceName",
"input": {
"storeKeys": [
"myStore",
],
"locales": [
"de",
],
"url": "http://commercetools.com",
"projectKey": "keyID",
},
"authenticationID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
},
)
# print the response
print(response)# Initialize the client
client = Algolia::IngestionClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
# Call the API
response = client.validate_source(
Algolia::Ingestion::SourceCreate.new(
type: "commercetools",
name: "sourceName",
input: Algolia::Ingestion::SourceCommercetools.new(
store_keys: ["myStore"],
locales: ["de"],
url: "http://commercetools.com",
project_key: "keyID"
),
authentication_id: "6c02aeb1-775e-418e-870b-1faccd4b2c0f"
)
)
# print the response
puts(response)// Initialize the client
val client = IngestionClient(
appId = "ALGOLIA_APPLICATION_ID",
apiKey = "ALGOLIA_API_KEY",
region = "ALGOLIA_APPLICATION_REGION"
)
// Call the API
val response = Await.result(
client.validateSource(
sourceCreate = Some(
SourceCreate(
`type` = SourceType.withName("commercetools"),
name = "sourceName",
input = Some(
SourceCommercetools(
storeKeys = Some(Seq("myStore")),
locales = Some(Seq("de")),
url = "http://commercetools.com",
projectKey = "keyID"
)
),
authenticationID = Some("6c02aeb1-775e-418e-870b-1faccd4b2c0f")
)
)
),
Duration(100, "sec")
)
// print the response
println(response)// Initialize the client
let client = try IngestionClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY", region: .us)
// Call the API
let response = try await client.validateSource(sourceCreate: SourceCreate(
type: SourceType.commercetools,
name: "sourceName",
input: SourceInput.sourceCommercetools(SourceCommercetools(
storeKeys: ["myStore"],
locales: ["de"],
url: "http://commercetools.com",
projectKey: "keyID"
)),
authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f"
))
// print the response
print(response){
"runID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
"createdAt": "<string>",
"data": [
{}
],
"eventID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
"events": [
{
"batchSize": 10,
"eventID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
"publishedAt": "<string>",
"runID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
"data": {}
}
],
"message": "<string>"
}{
"message": "Invalid Application-Id or API-Key"
}addObject, deleteIndex, editSettingsAuthorizations
Your Algolia application ID.
Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.
Body
Descriptive name of the source.
algoliaIndex, bigcommerce, bigquery, commercetools, csv, docker, ga4BigqueryExport, json, shopify, push Universally unique identifier (UUID) of an authentication resource.
"6c02aeb1-775e-418e-870b-1faccd4b2c0f"
Specific configuration attributes of a commercetools source.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
Show child attributes
Show child attributes
Response
OK
Universally unique identifier (UUID) of a task run.
"6c02aeb1-775e-418e-870b-1faccd4b2c0f"
Date and time when the resource was created, in RFC 3339 format.
This field is always null when used with the Push endpoint. When used for a source discover or source validate run, it will include the sampled data of the source.
Universally unique identifier (UUID) of an event.
"6c02aeb1-775e-418e-870b-1faccd4b2c0f"
in case of error, observability events will be added to the response.
Show child attributes
Show child attributes
a message describing the outcome of the operation that has been ran (push, discover or validate) run.
Was this page helpful?