generateAccessToken
Hi, do you know whether can I generateAccessToken with my seller user name and password ?
No. generateAccessToken accepts code as a parameter. You can get code after authorizing your app through the Lazada Open Platform Authorization page.
Thats sad, so they only have an implicit grant method ? Because I am a seller and wanted to do a server to server integration.
Yes. But you can always just generate the URL yourself, open the URL in a
browser, and then authorize your app. The code is returned as a URL query
parameter on your callback. (i.e. https://callback.url?code=randomcode)
Cannot generate access token with this package. My code is
const authCode = '0_118985_zUFFF5x0Wal7NNNRKPQFVjSZ2236' // replace valid authCode here const params = { code: authCode } const response = aLazadaAPI .generateAccessToken(params) .then(response => console.log(JSON.stringify(response, null, 4))) .catch(error => console.log(JSON.stringify(error, null, 4)))
getting this error "type": "ISV", "code": "IncompleteSignature", "message": "The request signature does not conform to lazada standards", "request_id": "0b86d3f015889470213992399"
Wizard-Rogue please help
@Wizard-Rogue please reply to my answer
Hi, are you looking at the examples/generateAccessToken.js ?
Beware of the input params:
- appKey
- appSecret
- countryCode
- authCode
If any one of them had some issues, Lazada will not give you a token back.
const aLazadaAPI = new LazadaAPI('app_key', 'app_secret', 'country_code')
const authCode = 'auth_code' // replace valid authCode here
const params = {
code: authCode,
}
Example errors:
IncompleteSignature Error
Something is wrong about the appSecret
{
"type": "ISV",
"code": "IncompleteSignature",
"message": "The request signature does not conform to lazada standards",
"request_id": "..."
}
InvalidCode Error
When authCode is expired.
{
"code": "InvalidCode",
"type": "ISP",
"message": "Invalid authorization code",
"request_id": "..."
}
InvalidAppKey Error
when appKey does not exist.
{
"type": "ISV",
"code": "InvalidAppKey",
"message": "The specified App Key is invalid",
"request_id": "..."
}
flow runtime error
Something is wrong about the countryCode
/[path]/lazada-open-platform-sdk/node_modules/flow-runtime/dist/flow-runtime.js:714
throw error;
^
TypeError [RuntimeTypeError]: countryCode must be one of: "SINGAPORE" | "THAILAND" | "MALAYSIA" | "VIETNAM" | "PHILIPPINES" | "INDONESIA"
Expected: "SINGAPORE" | "THAILAND" | "MALAYSIA" | "VIETNAM" | "PHILIPPINES" | "INDONESIA"
Actual Value: "SINGAPOR"
Actual Type: string
at new exports (/[path]/lazada-open-platform-sdk/lib/index.js:54:64)
at Object.<anonymous> (/[path]/lazada-open-platform-sdk/examples/generateAccessToken.js:23:20)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
errors: [
[
[],
'must be one of: "SINGAPORE" | "THAILAND" | "MALAYSIA" | "VIETNAM" | "PHILIPPINES" | "INDONESIA"',
[UnionType]
]
]
}
Hey @hanstf , did you figure out a way to generate code from code bypassing the oauth panel?
Hi @hanstf did you find solution?
how to get authcode. I need help getting order information