0

Good morning to everyone,

Well I am an alternating student and I am asked to create an API to retrieve data from their software. ( I don’t know much about API I discovered with an old project, so don’t judge my mistakes please ).

Code :

try:
    infos = client.api(method='Infos.getInfos')
    clientj = client.api('Client.getList',params={
        'order':{},
        'pagination':{},
        'search':{'periodecreated_start':{int(1577836800)}
        }
    })
except sellsy_api.SellsyAuthenticateError as e: 
    print('Authentication failed ! Details : {}'.format(e))
except sellsy_api.SellsyError as e: 
    print(e) 

Code Erreur :

Traceback (most recent call last):
  File "...", line 13, in <module>
    clientj = client.api('Client.getList',params={
  File "...", line 28, in api
    'do_in': json.dumps(payload)
  File "...", line 231, in dumps
    return _default_encoder.encode(obj)
  File "...", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "...", line 257, in iterencode
    return _iterencode(o, 0)
  File "...", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type set is not JSON serializable

Thanks you in advance,

0 Answers0