'Problème avec mon API en python
Well, I am a work-study 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 this project, so please don't judge my stupid mistakes).
The documentation : https://api.sellsy.fr/documentation/methodes
try:
infos = client.api(method='Client.getList', params={
'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)
I am getting this error:
infos = client.api(method='Client.getList', params={
^
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?
Here I am trying to get out the list of clients since 01/01/2020.
Thank you in advance,
Solution 1:[1]
params={....} is a keyword argument, sending presumably a dictionary to the method. The dictionary {'search':...} would be okay; {'search'=...} is not a valid dict syntax. Instead, it gets interpreted as a set, with a single value, the value of the expression 'search'=...; but that is not a grammatical expression in Python. The error is repeated with {'periodecreated_start'=...}....
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | lomba tech |
