(self, access_token)
return links
List of all user links.
        :param access_token:
        :return: dict
List of all user links.
        :param access_token:
        :return: dict
List of all user links . : param access_token : : return : dict
def list_links(self, access_token):
        """List of all user links.
        :param access_token:
        :return: dict
        """
        user_path = '/api/user/links'
        headers = self.header
        headers.update(
            dict(JWT_Authorization='Bearer {}'.format(access_token)))
        r = requests.get(self.rest_url + user_path, headers=headers)
        resp_obj = r.json()
        if int(r.status_code) == 401:
            if resp_obj['sub_status'] == 101:
                self.refresh_access_token()
                if self.header is None:
                    raise UnAuthorized('Please login again to continue')
                r = requests.get(self.rest_url + user_path,
                                 headers=self.header)
                resp_obj = r.json()
        if r.status_code // 100 != 2:
            if r.status_code == 401:
                return UnAuthorized('Please login again to continue')
            raise ObjectNotFound(resp_obj)
        links = resp_obj
        for link in links:
            if link.get('short_code'):
                link['short_url'] = self.makeurl(
                    self.HOSTNAME, link['short_code'])
        return links
def list_links ( self , access_token ) : user_path = '/api/user/links' headers = self . header headers . update ( dict ( JWT_Authorization = 'Bearer {}' . format ( access_token ) ) ) r = requests . get ( self . rest_url + user_path , headers = headers ) resp_obj = r . json ( ) if int ( r . status_code ) == 401 : if resp_obj [ 'sub_status' ] == 101 : self . refresh_access_token ( ) if self . header is None : raise UnAuthorized ( 'Please login again to continue' ) r = requests . get ( self . rest_url + user_path , headers = self . header ) resp_obj = r . json ( ) if r . status_code // 100 != 2 : if r . status_code == 401 : return UnAuthorized ( 'Please login again to continue' ) raise ObjectNotFound ( resp_obj ) links = resp_obj for link in links : if link . get ( 'short_code' ) : link [ 'short_url' ] = self . makeurl ( self . HOSTNAME , link [ 'short_code' ] ) return links