code: def _call_api(self, url, method='GET', params=None, data=None):
          
  
          req = self.session.request(
              method=method,
              url=url,
              params=params,
              headers=self.header,
              data=data,
              verify=not self.insecure,
          )
  
          output = None
          try:
              output = req.json()
          except Exception as err:
              LOG.debug(req.text)
              # TODO: use a dedicated error class
              raise Exception('Error while decoding JSON: {0}'.format(err))
  
          if req.status_code != 200:
              LOG.error(output)
              if 'error_code' in output:
                  raise APIError(output['error'])
          return output
docs: Method used to call the API.
          It returns the raw JSON returned by the API or raises an exception
          if something goes wrong.
  
          :arg url: the URL to call
          :kwarg method: the HTTP method to use when calling the specified
              URL, can be GET, POST, DELETE, UPDATE...
              Defaults to GET
          :kwarg params: the params to specify to a GET request
          :kwarg data: the data to send to a POST request