Appearance
Robot Entries
Manage robots.txt file entries to control search engine crawler access to your site. Configure Allow and Disallow directives for different user agents to optimize crawling and indexing behavior.
Basic CRUD Actions
Get Robot Entries listing
View on PostmanGet a list of all robots.txt entries.
JS
let robotEntries = await Client.API.Core.RobotEntries.all();TS
import { Response, RobotEntries } from "@tscommerce/sdk-typescript"
Client.API.Core.RobotEntries.all().then((response:Response<RobotEntries>) => {
response.resource.forEach((entry) => {
console.log(entry.id, entry.user_agent, entry.directive);
});
});PHP
$robotEntries = $client->API->Core->RobotEntries->all();Create new Robot Entry
View on PostmanCreate a new robots.txt directive.
JS
const payload = {
user_agent: 'Googlebot',
directive: 'Allow',
path: '/products/*'
};
let robotEntry = await Client.API.Core.RobotEntries.create(payload);TS
import { Response, RobotEntry, CreateRobotEntryPayload } from "@tscommerce/sdk-typescript"
const payload:CreateRobotEntryPayload = {
user_agent: 'Googlebot',
directive: 'Allow',
path: '/products/*'
};
Client.API.Core.RobotEntries.create(payload).then((response:Response<RobotEntry>) => {
console.log('Created robot entry:', response.resource);
});PHP
$payload = [
'user_agent' => 'Googlebot',
'directive' => 'Allow',
'path' => '/products/*'
];
$robotEntry = $client->API->Core->RobotEntries->create($payload);Get Robot Entry
View on PostmanGet an existing robot entry by ID.
JS
const robotEntryId = 123;
let robotEntry = await Client.API.Core.RobotEntries.read(robotEntryId);TS
import { Response, RobotEntry } from "@tscommerce/sdk-typescript"
const robotEntryId:RobotEntry['id'] = 123;
Client.API.Core.RobotEntries.read(robotEntryId).then((response:Response<RobotEntry>) => {
console.log('Robot entry:', response.resource);
});PHP
$robotEntryId = 123;
$robotEntry = $client->API->Core->RobotEntries->read($robotEntryId);Update Robot Entry
View on PostmanUpdate an existing robots.txt entry.
JS
const robotEntryId = 123;
const payload = {
path: '/products/category/*'
};
let robotEntry = await Client.API.Core.RobotEntries.update(robotEntryId, payload);TS
import { Response, RobotEntry, UpdateRobotEntryPayload } from "@tscommerce/sdk-typescript"
const robotEntryId:RobotEntry['id'] = 123;
const payload:UpdateRobotEntryPayload = {
path: '/products/category/*'
};
Client.API.Core.RobotEntries.update(robotEntryId, payload).then((response:Response<RobotEntry>) => {
console.log('Updated robot entry:', response.resource);
});PHP
$robotEntryId = 123;
$payload = ['path' => '/products/category/*'];
$robotEntry = $client->API->Core->RobotEntries->update($robotEntryId, $payload);Delete Robot Entry
View on PostmanDelete a robot entry.
JS
const robotEntryId = 123;
Client.API.Core.RobotEntries.delete(robotEntryId);TS
import { Response, RobotEntry } from "@tscommerce/sdk-typescript"
const robotEntryId:RobotEntry['id'] = 123;
Client.API.Core.RobotEntries.delete(robotEntryId).then((response:Response) => {
console.log('Robot entry deleted successfully');
});PHP
$robotEntryId = 123;
$client->API->Core->RobotEntries->delete($robotEntryId);Bulk Actions
Bulk delete Robot Entries
View on PostmanDelete multiple robot entries at once.
JS
const robotEntryIds = [123, 456, 789];
Client.API.Core.RobotEntries.bulkDelete({ ids: robotEntryIds });TS
import { Response, BulkDeleteRobotEntryPayload } from "@tscommerce/sdk-typescript"
const payload:BulkDeleteRobotEntryPayload = {
ids: [123, 456, 789]
};
Client.API.Core.RobotEntries.bulkDelete(payload).then((response:Response) => {
console.log('Robot entries deleted successfully');
});PHP
$payload = ['ids' => [123, 456, 789]];
$client->API->Core->RobotEntries->bulkDelete($payload);