בדף הזה מוסבר איך ליצור ולעדכן באופן פרוגרמטי את מקורות הנתונים שמאפשרים להוסיף מוצרים. מקורות נתונים אוטומטיים מאפשרים לשלוח בקלות את נתוני המוצרים שלכם ל-Google. מקורות נתונים אוטומטיים מוודאים שהמידע העדכני ביותר על מוצרים רלוונטיים מהאתר שלכם יגיע ל-Google.
באמצעות Content API for Shopping אפשר ליצור רק מקורות נתונים ראשיים. באמצעות Merchant Data sources API אפשר ליצור את סוגי מקורות הנתונים הבאים:
- מקורות ראשיים של נתוני מוצרים
- מקורות נתונים משלימים של מוצרים
- מקורות נתונים של מלאי בחנות הפיזית
- מקורות נתונים של מלאי אזורי
- מקורות לנתוני מבצעים
- מקורות נתונים של ביקורות על מוצרים
- מקורות נתונים של ביקורות על מוצרים של מוכרים
Content API for Shopping מאפשר לנהל רק מקורות נתונים עם קלט מקובץ. באמצעות Merchant API אפשר לנהל מקורות נתונים באמצעות קלט של קבצים וגם באמצעות קלט של ממשקי API.
בעזרת Merchant Data sources API תוכלו לבצע את הפעולות הבאות:
- יוצרים מקור נתונים ראשי חדש עם
feedLabel
ו-contentLanguage
ספציפיים. - יוצרים מקור נתונים בלי להגדיר את השדות
feedLabel
ו-contentLanguage
. בעזרת סוג מקור הנתונים הזה תוכלו לטרגט את המוצרים שלכם לכמה מדינות, כי תוכלו להוסיף מוצרים עם שילובים שונים שלfeedLabel
ו-contentLanguage
למקור נתונים יחיד. - יוצרים מקור נתונים משלים כדי לקשר אותו למקור נתונים ראשי קיים.
- מגדירים לוח זמנים למקור נתונים של קובץ.
- להירשם לחשבון לניהול אוטומטי של מקורות הנתונים.
- ניהול מקורות הנתונים של ה-API.
- ניהול כלל ברירת המחדל של מקורות הנתונים באמצעות מקורות נתוני מוצרים ראשיים.
- להשתמש בסוגים אחרים של מקורות נתונים, כמו קידומי מכירות.
אי אפשר להשתמש ב-Merchant API כדי להוסיף מוצרים למקור נתונים שמכיל גם מוצרים בחנות הפיזית וגם מוצרים באינטרנט. מידע נוסף על ערוצים של מקורות נתונים זמין במאמר ערוצים.
דרישות מוקדמות
- החשבון שלכם צריך לעבור להשתמש בפידים של לוקל אחד.
כדי לוודא שהחשבון כבר הועבר לחלוקת יעדי נתונים, משתמשים ברשימה של מקורות הנתונים או בשיטות ה-get. אם אתם לא עומדים בדרישות, תוצג לכם הודעת החריגה הבאה ותצטרכו לפנות לתמיכה.
This account is in the data sources migration process and can't be used with this API yet. Contact support for more info on when this account will be able to use the data sources endpoint.
יצירת מקור נתונים חדש
מקורות הנתונים הראשיים הם מקורות הנתונים העיקריים למלאי שלכם ב-Merchant Center. אפשר להוסיף או להסיר מוצרים רק באמצעות מקור נתונים ראשי. אם כל אחד מהמוצרים שאתם מוסיפים למקור הנתונים הראשי עומד בדרישות הסף ובדרישות הנתונים של Merchant Center, לא תצטרכו ליצור מקורות נתונים נוספים.
כדי ליצור מקור נתונים ראשי חדש עם feedLabel
ו-contentLanguage
ספציפיים, מגדירים את השדות feedLabel
ו-contentLanguage
בהגדרה הספציפית לסוג. מידע נוסף על השדות האלה זמין במאמר PrimaryProductDataSource
.
בבקשה לדוגמה הבאה מוסבר איך יוצרים מקור נתוני מוצרים ראשי:
POST https://merchantapi.googleapis.com/datasources/v1beta/accounts/{ACCOUNT_ID}/dataSources
{
"displayName": "{DISPLAY_NAME}",
"primaryProductDataSource": {
"contentLanguage": "{CONTENT_LANGUAGE}",
"feedLabel": "{FEED_LABEL}",
"countries": [
"{COUNTRY}"
],
"channel": "ONLINE_PRODUCTS"
}
}
מחליפים את מה שכתוב בשדות הבאים:
- {ACCOUNT_ID}: המזהה הייחודי של חשבון Merchant Center.
- {DISPLAY_NAME}: השם המוצג של מקור הנתונים.
- {CONTENT_LANGUAGE}: קוד השפה בן שתי האותיות של המוצרים במקור הנתונים, לפי התקן ISO 639-1.
- {FEED_LABEL}: תווית הפיד של מקור הנתונים.
- {COUNTRY}: קוד הטריטוריה של CLDR של מדינת היעד של המוצרים שיועלו באמצעות מקור הנתונים.
אחרי שהבקשה מופעלת בהצלחה, מופיעה התגובה הבאה:
{
"name": "accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}",
"dataSourceId": "{DATASOURCE_ID}",
"displayName": "{DISPLAY_NAME}",
"primaryProductDataSource": {
"channel": "ONLINE_PRODUCTS",
"feedLabel": "{FEED_LABEL}",
"contentLanguage": "{CONTENT_LANGUAGE}",
"countries": [
"{COUNTRY}"
],
"defaultRule": {
"takeFromDataSources": [
{
"self": true
}
]
}
},
"input": "API"
}
מידע נוסף על יצירת מקור נתונים זמין ב-method accounts.dataSources.create.
כדי להציג את מקור הנתונים החדש שיצרתם, משתמשים ב-method accounts.dataSources.get או ב-method accounts.dataSources.list.
הדוגמה הבאה ממחישה איך יוצרים מקור נתונים ראשי של מוצרים בשילוב של GB
ו-en
feedLabel
ו-contentLanguage
.
Java
public static String createDataSource(Config config, String displayName) throws Exception {
GoogleCredentials credential = new Authenticator().authenticate();
DataSourcesServiceSettings dataSourcesServiceSettings =
DataSourcesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
String parent = getParent(config.getAccountId().toString());
// The type of data that this datasource will receive.
PrimaryProductDataSource primaryProductDataSource =
PrimaryProductDataSource.newBuilder()
// Channel can be "ONLINE_PRODUCTS" or "LOCAL_PRODUCTS" or "PRODUCTS" .
// While accepted, datasources with channel "products" representing unified products
// currently cannot be used with the Products bundle.
.setChannel(PrimaryProductDataSource.Channel.ONLINE_PRODUCTS)
.addCountries("GB")
.build();
try (DataSourcesServiceClient dataSourcesServiceClient =
DataSourcesServiceClient.create(dataSourcesServiceSettings)) {
CreateDataSourceRequest request =
CreateDataSourceRequest.newBuilder()
.setParent(parent)
.setDataSource(
DataSource.newBuilder()
.setDisplayName(displayName)
.setPrimaryProductDataSource(primaryProductDataSource)
.build())
.build();
System.out.println("Sending Create PrimaryProduct DataSource request");
DataSource response = dataSourcesServiceClient.createDataSource(request);
System.out.println("Created DataSource Name below");
System.out.println(response.getName());
return response.getName();
} catch (Exception e) {
System.out.println(e);
System.exit(1);
// Null is necessary to satisfy the compiler as we're not returning a String on failure.
return null;
}
}
יצירת מקור נתונים ראשי חדש שיעזור לכם לטרגט כמה מדינות
כדי ליצור פיד ראשי חדש שיעזור לכם לטרגט כמה מדינות, מגדירים את מקור הנתונים באמצעות PrimaryProductDataSource
ולא מגדירים את השדות feedLabel
ו-contentLanguage
.
כשמשתמשים ב-Content API for Shopping, נוצר רק מקור נתונים אחד של API. באמצעות Merchant Data sources API, אפשר להשתמש בכמה מקורות נתונים של API, חלקם ללא הגדרת השדות feedLabel
ו-contentLanguage
.
רק מקורות נתונים עם קלט API יכולים להיות ללא הגדרת השדות feedLabel
ו-contentLanguage
. אין תמיכה במקורות הנתונים האלה להזנת קבצים.
יצירת מקור נתונים משלים וקישור שלו למקור הנתונים הראשי
מקורות נתונים משלימים משמשים רק לעדכון נתוני מוצרים שכבר קיימים במקור נתונים ראשי אחד או יותר. אפשר ליצור כמה מקורות נתונים משלימים, וכל אחד מהם יכול להשלים את הנתונים של כמה מקורות נתונים ראשיים.
אפשר להשתמש במקורות נתונים משניים כדי לבצע עדכונים חלקיים של נתוני המוצרים. לשם כך, מוסיפים את המזהה הייחודי של מקור הנתונים כפרמטר של שאילתה כשמבצעים קריאות ל-methods accounts.productInputs.insert
ו-accounts.productInputs.delete
. אפשר להשתמש במקורות נתונים משלימים רק כדי לעדכן מוצרים קיימים.
כדי ליצור מקור נתונים משלים, מגדירים את מקור הנתונים באמצעות SupplementalProductDataSource
ולאחר מכן מקשרים אותו על ידי עדכון השדה defaultRule
במקור הנתונים הראשי.
במקורות נתונים של קובץ משלים, צריך להגדיר את השדות feedLabel
ו-contentLanguage
. בשדות feedLabel
ו-contentLanguage
של מקורות נתונים משלימים ל-API, הערך תמיד צריך להיות לא מוגדר.
הדוגמה הבאה ממחישה איך יוצרים מקור נתונים משלים של מוצרים בקובץ בשילוב של en
ו-GB
contentLanguage
ו-feedLabel
.
Java
private static FileInput setFileInput() {
// If FetchSettings are not set, then this will be an `UPLOAD` file type
// that you must manually upload via the Merchant Center UI.
return FileInput.newBuilder()
// FileName is required for `UPLOAD` fileInput type.
.setFileName("British T-shirts Supplemental Data")
.build();
}
public static String createDataSource(Config config, String displayName, FileInput fileInput)
throws Exception {
GoogleCredentials credential = new Authenticator().authenticate();
DataSourcesServiceSettings dataSourcesServiceSettings =
DataSourcesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
String parent = getParent(config.getAccountId().toString());
try (DataSourcesServiceClient dataSourcesServiceClient =
DataSourcesServiceClient.create(dataSourcesServiceSettings)) {
CreateDataSourceRequest request =
CreateDataSourceRequest.newBuilder()
.setParent(parent)
.setDataSource(
DataSource.newBuilder()
.setDisplayName(displayName)
.setSupplementalProductDataSource(
SupplementalProductDataSource.newBuilder()
.setContentLanguage("en")
.setFeedLabel("GB")
.build())
.setFileInput(fileInput)
.build())
.build();
System.out.println("Sending create SupplementalProduct DataSource request");
DataSource response = dataSourcesServiceClient.createDataSource(request);
System.out.println("Created DataSource Name below");
System.out.println(response.getName());
return response.getName();
} catch (Exception e) {
System.out.println(e);
System.exit(1);
// Null is necessary to satisfy the compiler as we're not returning a String on failure.
return null;
}
}
כדי ליצור מקור נתונים משלים שפועל בכל השילובים של feedLabel
ו-contentLanguage
, מריצים את הדוגמה הבאה.
Java
public static String createDataSource(Config config, String displayName) throws Exception {
GoogleCredentials credential = new Authenticator().authenticate();
DataSourcesServiceSettings dataSourcesServiceSettings =
DataSourcesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
String parent = getParent(config.getAccountId().toString());
try (DataSourcesServiceClient dataSourcesServiceClient =
DataSourcesServiceClient.create(dataSourcesServiceSettings)) {
CreateDataSourceRequest request =
CreateDataSourceRequest.newBuilder()
.setParent(parent)
.setDataSource(
DataSource.newBuilder()
.setDisplayName(displayName)
.setSupplementalProductDataSource(
SupplementalProductDataSource.newBuilder().build())
.build())
.build();
System.out.println("Sending create SupplementalProduct DataSource request");
DataSource response = dataSourcesServiceClient.createDataSource(request);
System.out.println("Created DataSource Name below");
System.out.println(response.getName());
return response.getName();
} catch (Exception e) {
System.out.println(e);
System.exit(1);
return null; // Necessary to satisfy the compiler as we're not returning a
// String on failure.
}
}
הגדרת תזמון למקור נתוני הקובץ
כדי להגדיר לוח זמנים לפיד הקבצים, מגדירים את מקור הנתונים כמקור נתונים של קובץ באמצעות השדה FileInput
, ולאחר מכן מגדירים את fetchsettings
באמצעות השדה FileInput.FetchSettings
.
מחיקה של מקור נתונים
כדי למחוק מקור נתונים קיים מהחשבון, משתמשים ב-method accounts.dataSources.delete
.
הדוגמה הבאה מראה איך משתמשים בחבילה DeleteDataSourceRequest
כדי למחוק מקור נתונים.
Java
public static void deleteDataSource(Config config, String dataSourceId) throws Exception {
GoogleCredentials credential = new Authenticator().authenticate();
DataSourcesServiceSettings dataSourcesServiceSettings =
DataSourcesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
String name =
DataSourceName.newBuilder()
.setAccount(config.getAccountId().toString())
.setDatasource(dataSourceId)
.build()
.toString();
try (DataSourcesServiceClient dataSourcesServiceClient =
DataSourcesServiceClient.create(dataSourcesServiceSettings)) {
DeleteDataSourceRequest request = DeleteDataSourceRequest.newBuilder().setName(name).build();
System.out.println("Sending deleteDataSource request");
// Delete works for any datasource type.
// If Type "Supplemental", delete will only work if it's not linked to any primary feed.
// If a link exists and the Type is "Supplemental", you will need to remove the supplemental
// feed from the default and/or custom rule(s) of any primary feed(s) that references it. Then
// retry the delete.
dataSourcesServiceClient.deleteDataSource(request); // No response returned on success.
System.out.println(
"Delete successful, note that it may take a few minutes for the delete to update in"
+ " the system.");
} catch (Exception e) {
System.out.println(e);
}
}
אחזור מקור הנתונים
כדי לאחזר קובץ שהוגדר במקור הנתונים, משתמשים ב-method accounts.dataSources.fetch
. השיטה הזו מבצעת את אחזור הנתונים באופן מיידי ממקור נתונים מהחשבון שלכם. השיטה הזו פועלת רק במקורות נתונים עם הגדרת קלט של קובץ.
אחזור מקור הנתונים
כדי לאחזר את ההגדרות של מקור הנתונים בחשבון, משתמשים בשיטה accounts.dataSources.get
.
הדוגמה הבאה ממחישה איך אפשר להשתמש בחבילה GetDataSourceRequest
כדי לאחזר מקור נתונים ספציפי בחשבון Merchant Center נתון.
Java
public static DataSource getDataSource(Config config, String dataSourceId) throws Exception {
// Obtains OAuth token based on the user's configuration.
GoogleCredentials credential = new Authenticator().authenticate();
// Creates service settings using the credentials retrieved above.
DataSourcesServiceSettings dataSourcesServiceSettings =
DataSourcesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Creates datasource name to identify datasource.
String name =
DataSourceName.newBuilder()
.setAccount(config.getAccountId().toString())
.setDatasource(dataSourceId)
.build()
.toString();
// Calls the API and catches and prints any network failures/errors.
try (DataSourcesServiceClient dataSourcesServiceClient =
DataSourcesServiceClient.create(dataSourcesServiceSettings)) {
// The name has the format: accounts/{account}/datasources/{datasource}
GetDataSourceRequest request = GetDataSourceRequest.newBuilder().setName(name).build();
System.out.println("Sending GET DataSource request:");
DataSource response = dataSourcesServiceClient.getDataSource(request);
System.out.println("Retrieved DataSource below");
System.out.println(response);
return response;
} catch (Exception e) {
System.out.println(e);
System.exit(1);
return null; // Necessary to satisfy the compiler as we're not returning a
// DataSource on failure.
}
}
הצגת רשימה של מקורות הנתונים
כדי לקבל רשימה של ההגדרות של מקורות הנתונים בחשבון, משתמשים ב-method accounts.dataSources.list
.
הדוגמה הבאה ממחישה איך אפשר להשתמש בחבילה ListDataSourceRequest
כדי לקבל רשימה של כל מקורות הנתונים בחשבון Merchant Center נתון.
Java
public static ArrayList<DataSource> listDataSources(Config config) throws Exception {
// Obtains OAuth token based on the user's configuration.
GoogleCredentials credential = new Authenticator().authenticate();
// Creates service settings using the credentials retrieved above.
DataSourcesServiceSettings dataSourcesServiceSettings =
DataSourcesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Creates parent to identify the account from which to list all the datasources.
String parent = getParent(config.getAccountId().toString());
// Calls the API and catches and prints any network failures/errors.
try (DataSourcesServiceClient dataSourcesServiceClient =
DataSourcesServiceClient.create(dataSourcesServiceSettings)) {
// The parent has the format: accounts/{account}
ListDataSourcesRequest request =
ListDataSourcesRequest.newBuilder().setParent(parent).build();
System.out.println("Sending list datasources request:");
ListDataSourcesPagedResponse response = dataSourcesServiceClient.listDataSources(request);
int count = 0;
ArrayList<DataSource> dataSources = new ArrayList<DataSource>();
ArrayList<DataSource> justPrimaryDataSources = new ArrayList<DataSource>();
// Iterates over all rows in all pages and prints the datasource in each row.
// Automatically uses the `nextPageToken` if returned to fetch all pages of data.
for (DataSource element : response.iterateAll()) {
System.out.println(element);
count++;
dataSources.add(element);
// The below lines show how to filter datasources based on type.
// `element.hasSupplementalProductDataSource()` would give you supplemental
// datasources, etc.
if (element.hasPrimaryProductDataSource()) {
justPrimaryDataSources.add(element);
}
}
System.out.print("The following count of elements were returned: ");
System.out.println(count);
return dataSources;
} catch (Exception e) {
System.out.println(e);
System.exit(1);
return null; // Necessary to satisfy the compiler as we're not returning an
// ArrayList<DataSource> on failure.
}
}
מקור הנתונים של התיקון
כדי לעדכן את ההגדרה של מקור נתונים קיים, משתמשים ב-method accounts.dataSources.patch
.
הדוגמה הבאה מראה איך משתמשים בחבילה UpdateDataSourceRequest
כדי לעדכן מקור נתונים. בנוסף, מוסבר איך לעדכן מקור נתונים ראשי כדי להוסיף מקורות נתונים משלימים לכלל ברירת המחדל שלו.
Java
public static String updateDataSource(Config config, String displayName, String dataSourceId)
throws Exception {
GoogleCredentials credential = new Authenticator().authenticate();
DataSourcesServiceSettings dataSourcesServiceSettings =
DataSourcesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Creates datasource name to identify datasource.
String name =
DataSourceName.newBuilder()
.setAccount(config.getAccountId().toString())
.setDatasource(dataSourceId)
.build()
.toString();
DataSource dataSource =
DataSource.newBuilder()
// Update the datasource to have the new display name
.setDisplayName(displayName)
.setName(name)
.build();
FieldMask fieldMask = FieldMask.newBuilder().addPaths("display_name").build();
try (DataSourcesServiceClient dataSourcesServiceClient =
DataSourcesServiceClient.create(dataSourcesServiceSettings)) {
UpdateDataSourceRequest request =
UpdateDataSourceRequest.newBuilder()
.setDataSource(dataSource)
.setUpdateMask(fieldMask)
.build();
System.out.println("Sending Update DataSource request");
DataSource response = dataSourcesServiceClient.updateDataSource(request);
System.out.println("Updated DataSource Name below");
System.out.println(response.getName());
return response.getName();
} catch (Exception e) {
System.out.println(e);
System.exit(1);
return null;
}
}
public String updateDataSource(
Config config,
String primaryDataSourceName,
String firstSupplementalDataSourceName,
String secondSupplementalDataSourceName)
throws Exception {
GoogleCredentials credential = new Authenticator().authenticate();
DataSourcesServiceSettings dataSourcesServiceSettings =
DataSourcesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Setting self to 'true' refers to the primary datasource itself.
DataSourceReference dataSourceReferenceSelf =
DataSourceReference.newBuilder().setSelf(true).build();
DataSourceReference firstSupplementalDataSourceReference =
DataSourceReference.newBuilder()
.setSupplementalDataSourceName(firstSupplementalDataSourceName)
.build();
DataSourceReference secondSupplementalDataSourceReference =
DataSourceReference.newBuilder()
.setSupplementalDataSourceName(secondSupplementalDataSourceName)
.build();
// The attributes will first be taken from the primary DataSource.
// Then the first supplemental DataSource if the attribute is not in the primary DataSource
// And finally the second supplemental DataSource if not in the first two DataSources.
// Note that CustomRules could change the behavior of how updates are applied.
DefaultRule defaultRule =
DefaultRule.newBuilder()
.addTakeFromDataSources(dataSourceReferenceSelf)
.addTakeFromDataSources(firstSupplementalDataSourceReference)
.addTakeFromDataSources(secondSupplementalDataSourceReference)
.build();
// The type of data that this datasource will receive.
PrimaryProductDataSource primaryProductDataSource =
PrimaryProductDataSource.newBuilder().setDefaultRule(defaultRule).build();
DataSource dataSource =
DataSource.newBuilder()
// Update the primary datasource to have the default rule datasources in the correct
// order.
.setPrimaryProductDataSource(primaryProductDataSource)
.setName(primaryDataSourceName)
.build();
// The '.' signifies a nested field.
FieldMask fieldMask =
FieldMask.newBuilder().addPaths("primary_product_data_source.default_rule").build();
try (DataSourcesServiceClient dataSourcesServiceClient =
DataSourcesServiceClient.create(dataSourcesServiceSettings)) {
UpdateDataSourceRequest request =
UpdateDataSourceRequest.newBuilder()
.setDataSource(dataSource)
.setUpdateMask(fieldMask)
.build();
System.out.println("Sending Update DataSource request");
DataSource response = dataSourcesServiceClient.updateDataSource(request);
System.out.println("Updated DataSource Name below");
System.out.println(response.getName());
return response.getName();
} catch (Exception e) {
System.out.println(e);
System.exit(1);
return null;
}
}
קישור מקורות נתונים
מקורות נתוני מוצרים ראשיים מאפשרים לכם לנהל את הכלל שמוגדר כברירת מחדל למקורות הנתונים. כלל ברירת המחדל הוא הכלל שחלה על כל המאפיינים במקור הנתונים. אפשר להגדיר את כלל ברירת המחדל בזמן יצירת מקור הנתונים, או לעדכן מקור נתונים קיים דרך השדה של כלל ברירת המחדל.
מידע נוסף על הגדרת כללים זמין במאמר הגדרת כללים למקורות נתוני מוצרים.
ההגדרה לדוגמה הבאה מבטיחה שכל המאפיינים נלקחים קודם ממקור הנתונים עם המזהה הייחודי 1001
. לאחר מכן, המאפיינים החסרים מתווספים ממקור הנתונים הראשי. בסופו של דבר, המאפיינים הנותרים יילקחו ממקור הנתונים המשלים עם המזהה הייחודי 1002
, אם הם לא יסופקו כבר במקור נתונים אחר. אם אותו מאפיין מופיע במספר מקורות נתונים, המערכת בוחרת את הערך שנמצא גבוה יותר ברשימה.
defaultRule {
takeFromDataSources: [
'1001', // Supplemental product data source
'self', // Self reference to the primary data source
'1002' // Supplemental product data source
]
}
ניהול אוטומטי של פידים
כדי לרשום את החשבון לניהול אוטומטי של מקורות הנתונים, צריך לבצע את הפעולות הבאות:
- כדי לבדוק אם החשבון עומד בדרישות להרשמה, צריך להפעיל את השיטה
accounts.autofeedSettings.getAutofeedSettings
. - מוודאים שהחשבון הוא לא חשבון בזירת מסחר.
אחרי שהחשבון שלכם עומד בדרישות להרשמה, תוכלו להשתמש בשיטה accounts.autofeedSettings.updateAutofeedSettings
כדי להפעיל ניהול אוטומטי של מקורות הנתונים. כשמפעילים את הניהול האוטומטי של מקורות הנתונים, Google יכולה להוסיף באופן אוטומטי את המוצרים מהחנות הווירטואלית שלכם ולוודא שהם תמיד עדכניים בפלטפורמות של Google.
אחזור סטטוס העלאת קובץ
כדי לקבל את הסטטוס של מקור נתונים עם קובץ, אחזור או גיליון אלקטרוני, אפשר להפעיל את השיטה GET
של השירות accounts.dataSources.fileUploads
. כדי לקבל את התוצאה של אחזור מקור הנתונים האחרון שמחושב באופן אסינכרוני בסיום העיבוד של מקור הנתונים, משתמשים במזהה השם latest
.
GET https://merchantapi.googleapis.com/accounts/v1beta/{ACCOUNT_ID}/datasources/{DATASOURCE_ID}/fileUploads/latest
סטטוס העלאת הקובץ עשוי לכלול תצוגה מפורטת של המוצרים, כולל בעיות אפשריות.
שימו לב: ייתכן שסטטוס העלאת הקובץ לא יופיע אם הקובץ לא הועלה אף פעם. סטטוס העלאת הקובץ עשוי להיות 'בטיפול' אם הבקשה נשלחה זמן קצר אחרי העלאת הקובץ.