Forum Discussion

AlexisMoniot's avatar
New Contributor
2 years ago

Use UUID requests in python

Hi everybody, 

I 'm new user with swagger and a I have a issue with this requests

I try this : 

       params = {"CNX": "CNX", "Identifiant": "USER", "MotDePasse": "MyPW"}
       response =, json=params)
       responseJSON = response.json()
       UUID = responseJSON['UUID']
I have my UUID but when I want to use it, not working : 
example : 
       api_url_Doc = "https://MyURL/api/v1/sessions/dossier"
       params = {"CNX": "CNX", "UUID": UUID}
        response = requests.get(api_url_Doc, json=params)
        responseJSON = response.json()
Always same response, then a try to use UUID with all operators. I seems to be with UUID but it works with the swagger interface testing... 
        <Response [500]>
       {u'Message': u'Une erreur s\u2019est produite.'}



1 Reply

  • I tried with curl but same result ... 


    import pycurl

    from urllib.parse import urlencode

    c = pycurl.Curl()

    c.setopt(c.URL, 'https://MyURL/api/v1/sessions/dossier/022790')

    post_data={'CNX':'CNX', 'UUID':UUID}


    c.setopt(c.POSTFIELDS, postfields)


    print('Response code: %d' % c.getinfo(c.RESPONSE_CODE))



    >>> Response code: 400