需要 write_translation 权限点。
更多权限点使用信息,请参考:
PUT https://{handle}.myshopline.com/admin/openapi/v20260301/ugc/resource.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
更新店铺的翻译语料。你可以使用该接口基于指定市场 ID(market)、语言(locale)、资源 ID(resource_id)、资源类型(resource_type)对应的翻译语料内容(resource_content) 和资源对应的类型细分(resource_field) 进行更新。
请求头
  • Content-Type string required
    字段值固定为 application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入。
    例子:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
  • resource_listobject[] required
    待更新的资源对象列表。
    最大个数限制:200。
  • locale string required
    市场 里面使用的语言。
    例子: en
  • market string
    商店的主要市场。
    例子: 2805652120189036673434
  • resource_id string required
    资源的唯一标识符。
    样例:当 resource_typePRODUCT 时,该参数值为商品 ID。
  • resource_type string required
    资源的类型。
  • content_listobject[] required
    资源对应的翻译语料列表。
    最大个数限制:100。
  • resource_content string required
    资源对应的翻译语料内容。
    例子: The content of the key to the key of the cot
  • resource_field string required
    resource_content 的内容关联的属性。例如,如果 resource_content 返回产品标题,则 resource_field 返回 title
状态码
更多状态码信息,参考 HTTP 状态码

响应头
  • traceId
    请求的全局唯一标识符。用于追踪请求在系统中的流转,以便于问题发生时进行定位和调试。
响应体
  • dataobject
    响应结果。
  • fail_listobject[]
    商店语料数据的更新失败列表。
  • resource_field string
    resource_content 的内容关联的属性。例如,如果 resource_content 返回产品标题,则 resource_field 返回 title
    例子: title
  • resource_id string
    资源对象的标识符。
    样例:当 resource_typePRODUCT,代表商品 ID。
  • resource_type string
    资源的类型。
    例子: PRODUCT
  • fail_cause string
    更新失败原因。
    例子: VERIFY_RESOURCE_FAIL
  • locale string
    市场 里面使用的语言。
    例子: en
  • market string
    商店的主要市场。
    例子: 2805652120189036673434
  • resource_content string
    资源对应的翻译语料内容。
    例子: The content of the key to the key of the cot
  • resource_listobject[]
    更新的资源集合列表。
  • resource_type string
    资源的类型。
    例子: PRODUCT
  • updated_at string
    语料更新时间。格式:ISO 8601
    例子: 2023-09-07T15:50:00Z
  • locale string
    市场 里面使用的语言。
    例子: en
  • market string
    商店的主要市场。
    例子: 2805652120189036673434
  • outdated boolean
    查询过时或最新的翻译数据。如果原始内容已更新但翻译尚未更新,则翻译将被标记为“过时”。
    • true: 查询过时的翻译数据。
    • false: 查询最新的翻译数据。
  • resource_content string
    资源对应的翻译语料内容。
    例子: The content of the key to the key of the cot
  • resource_field string
    resource_content 的内容关联的属性。例如,如果 resource_content 返回产品标题,则 resource_field 返回 title
  • resource_id string
    资源对象的标识符。
    样例:当 resource_typePRODUCT,代表商品 ID。
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301

ParamOptions

header required

Body

required
{
  "resource_list": [
    {
      "market": "2805652120189036673434",
      "resource_id": "",
      "resource_type": "",
      "content_list": [
        {
          "resource_content": "The content of the key to the key of the cot",
          "resource_field": ""
        }
      ],
      "locale": "en"
    }
  ]
}

Language

curl --request PUT \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301/ugc/resource.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
更新特定市场英文语种下的某一商品标题语料
Request
{
"resource_list": [
{
"resource_id": "16067911850440298506251820",
"resource_type": "PRODUCT",
"content_list": [
{
"resource_content": "test content1",
"resource_field": "title"
}
],
"locale": "en",
"market": "2805979406510623080534"
},
{
"market": "2805979406510623080535",
"resource_id": "16067911850440298506251820",
"resource_type": "PRODUCT",
"content_list": [
{
"resource_content": "test content2",
"resource_field": "title"
}
],
"locale": "en"
}
]
}
Response
{
"data": {
"fail_list": [
{
"locale": "en",
"market": "2805979406510623080535",
"resource_content": "test content2",
"resource_field": "title",
"resource_id": "16067911850440298506251820",
"resource_type": "PRODUCT",
"fail_cause": "MARKET_NOT_EXIST"
}
],
"resource_list": [
{
"resourceContent": "test content1",
"resourceField": "title",
"resourceId": "16067911850440298506251820",
"resourceType": "PRODUCT",
"updatedAt": "2025-01-04T07:01:18Z",
"locale": "en",
"market": "2805979406510623080534",
"outdated": false
}
]
}
}
这篇文章对你有帮助吗?