• Getting Started
    • Mobile Integration (Android/IOS)
      Enterprise Solutions
      Accept Payments
      Process Payments
      Disbursals
      API References
      Webhooks
      Testing
      Refunds
      Guides
      Other Processes
      Mini Program Platform
        Website Integration

      Open gallery and pick an image JS API

      Use Case


      Use the bridge below to open a custom image picker on iOS/Android, and get a callback once the user has picked an image or has canceled


      Request Attributes

      Content format: JSON

      ParameterDescriptionRequiredExample Value
      requestCodeAndroid recognizes it, safe to pass for both iOS and AndroidNo456
      titleTitle to be displayed on activity picker dialog(only Android recognizes it, safe to pass for both iOS and Android)NoPaytm

      Response Attributes

      Success:

      Note: Response comes in json with 'data' as key
      ParameterDescriptionExample Value
      data.base64The base 64 string of the image received1
      data.meta.imageNameImageName100002890.jpg
      data.meta.imageSizeImage size in bytes1941277
      data.meta.imageTypeThis includes image type (jpg, png, etc)"jpg"

      Error Responses:

      ParameterDescriptionExample Value
      errorError2
      messageError messageinvalid parameters

      ERROR CODES

      codeDescription
      2Invalid parameter


      Request CodeResponse JSON
      
                  const requestObject={
                          requestCode: 456,// only Android recognizes it, safe to pass for both iOS and Android
                          requestCode: 'Title to be displayed on activity picker dialog',// only Android recognizes it, safe to pass for both iOS and Android
                  }
      
                  JSBridge.call('paytmOpenGallery',requestObject,
                   function(result) {
                      console.log(JSON.stringify(result))
                 });