Skip to content

General data push API solution

Unified API solution for Lenovo to push data to partners

TIP

  • Use HTTPS as transport protocol, default POST request
  • The API follows the REST style and uses JSON as the message transmission protocol by default
  • Pay attention to the UrlEncode situation
  • Interface limit: RequestBody is less than 500 by default and less than 1Mb -Default timeout 60s
  • The domain name recommendation is standard 443, other security may reject the firewall

Partners provide data push receiving addresses

Example

EnvironmentURL
Testhttps://api.******.com/uat/v1.0/scc/data/sync/{data_category}/{biz_key}
Officialhttps://api.******.com/v1.0/scc/data/sync/{data_category}/{biz_key}

Support authentication method

Select your authentication method and provide targeted authentication configurations

Basic Auth

-username -password

OAuth 2.0 - Client Credentials

-clientld -clientSecret -authPath

OAuth 2.0 - Password Credentials

-clientld -clientSecret -authPath -username -password

Public request parameters

Before calling, please obtain Token first

Parameter locationParameter nameDescriptionRemarks
Http MethodFollow REST API specificationsAdd: POST, modify: PUT, delete: DELETE, full coverage: PATCH (clear historical data, then write current data)
----
HeaderAuthorizationDetermined based on authentication methodBearer aaf0d4d6-c541-34cd-a4e0-03da1cc4019d
----
Url Pathdata_categoryData classificationRefer to the specific data interface URL
Url Pathbiz_keyBusiness keywordRefer to the specific data interface URL

Public request parameters

PositionNameRequiredTypeLengthDescription
Bodybatch_idYString16Batch ID, generated by partners to ensure batch uniqueness
Bodybatch_sizeYNumber---Total amount of data in the batch
Bodyseq_idYStringWithin the batch, each sequence number
Bodyseq_sizeYNumber---Each time, the amount of data to be pushed 500 >= size >= 1

Public response parameters

LocationNameRequiredTypeFormatDescriptionExample
BodycodeYString---Status code"0" represents success, other failures can refer to the return code
BodymsgNString---Prompt messageIf it is not "0", an error message will be prompted
BodyresultNobject/array---data body
  • Request example

    • URL: https://api.******.com/uat/v1.0/scc/data/sync/odm/master_data
    • Header : Authorization = Bearer aaf0d4d6-c541-34cd-a4e0-03da1cc4019d
  • Request parameters

json
{
  "batch_id": "LCFC202206230001",
  "batch_size": "250000",
  "seq_id": "1",
  "seq_size": "2",
  "data": [
    {
      "LENOVO_PN": "SD10W87241",
      "PLANT": "H121",
      "QTY": "1000"
    },
    {
      "LENOVO_PN": "SD10W87241",
      "PLANT": "H121",
      "QTY": "1000"
    }
  ]
}
  • Response example
json
{
  "code": "0",
  "msg": "request success"
}
  • Exception examples
json
{
  "code": "E00V00",
  "msg": "data verification failed!",
  "result": [
    {
      "row": {
        "odm": "LCFC",
        ...
      },
      "verify": [
        {
          "type": "value length exceed",
          "fields": "version"
        }
      ]
    }
  ]
}

General error code description

Parameter positionValueDescription
httpcode200Normal return result
httpcode401Token error/Signature error
httpcode404The accessed path does not exist
httpcode500Server error
body.code"0"Success
body.code"-1"System error
body.code"E00A00"The sequence data has been successfully consumed
body.code"E00P00"Retry to reach upper limit
body.code"E00V00"Packet verification failed, details will be reflected in the result
body.code"E00W00"Write exception, unique constraint violation
body.code"E00M00"Multiple exceptions, the result contains multiple codes and messages