decodeUrlContent

The decodeUrlContent API is called by the super app to decode the URL that is generated from a promotion QR code.

Method signature

copy
function decodeUrlContent(
  url: string,
  success: (result: string) => void,
  error?: (error: BaseError) => void
) 

Request parameters

Field

Data type

Required

Description

url

String

Yes

Indicates the URL content to be decoded.

success

String

Yes

The callback function that indicates whether the API call is successful.

error

BaseError

No

The callback that is executed upon failure to call this API. When executed, it receives an instance of BaseError object that includes the error code and its corresponding error description. Specify this parameter if you need to handle the encountered errors.

Response parameters

N/A

Sample

copy
 function decodeUrl(url:string){
    canDecodeUrl(url,(canDecode:boolean) =>{
       if(canDecode){
         decodeUrlContent(url,(codeUrl:string)=>{
          // codeUrl
         },(error: BaseError) => {
          // error
         })
       }else{
         //
       }
    })
  }