My goal is to make multiple Get
calls from the results of the first call, then concatenate the clients informations into dataframe. Preferable a faster way because I have a million clients ids
--------------------------------------
| id | name | country | city | phone |
--------------------------------------
| 1 | Leo | France | Paris | 212...|
| . | .. | .. | .. | .. |
| 100| Bale | UK | London| 514...|
The basic request / results (all clients):
import requests
from requests.auth import HTTPBasicAuth
# the initial request which returns all clients
res0 = requests.get('https://x.y.z/api/v1/data/clients', auth=HTTPBasicAuth('me', 'blabla'))
# results
<?xml version="1.0" ?>
<queryResponse>
<entityId type="clients" url="https://x.y.z/api/v1/data/clients/1">1</entityId>
...
...
<entityId type="clients" url="https://x.y.z/api/v1/data/clients/100">100</entityId>
</queryResponse>
The detailed request / results (client infos)
# this request allows to get client informations
res1 = requests.get('https://x.y.z/api/v1/data/clients/1', auth=HTTPBasicAuth('me', 'blabla'))
# results
<queryResponse>
<entity type="client_infos" url="https://x.y.z/api/v1/data/clients/1">
<client_infos displayName="1" id="1">
<name>Leo Massina</name>
<country>France</country>
<city>1607695021057</city>
<phone>+212-61-88-65-123</phone>
</client_infos >
</entity>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…