def get_identity(identity_id): """gets the identity by id does not change status""" response = api.verifier_peek_request(long(identity_id)) if 'result' in response: return Identity(response['result']) else: log.error(response) return None
def get_identity_for_processing(identity_id): """gets the identity for processing sets status to in processing""" response = api.verifier_take_pending_request(long(identity_id)) if 'result' in response: return Identity(response['result']) else: log.error(response) return None
def make_request(payload): """Makes a request using the configuration specified in settings.py, and the payload that has been passed in""" log.info("make_request\n{0}\n{1}".format(settings.API_URL, payload['method'])) # log.debug("make_request\n{0}\n{1}".format(settings.API_URL, # json.dumps(payload))) response = requests.post(settings.API_URL, data=json.dumps(payload), headers={"content-type": "application/json"}, auth=(settings.API_USER, settings.API_PASS)) #log.debug(response.content) response_json = response.json() if 'error' in response_json: log.error(response_json['error']) return response_json