POST https://sso-dev.art-informatique.com/auth/realms/recette/protocol/openid-connect/token200
149 ms
▶Network
▶Request Headers
Content-Type: application/x-www-form-urlencoded
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
User-Agent: PostmanRuntime/7.29.2
Accept: */*
Cache-Control: no-cache
Postman-Token: 00000000000000000000000000
Host: sso-dev.art-informatique.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 29
▶Request Body
grant_type: "client_credentials"
▶Response Headers
Server: nginx
Date: Sun, 06 Nov 2022 05:09:09 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-store
Set-Cookie: KC_RESTART=; Version=1; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Max-Age=0; Path=/auth/realms/recette/; Secure; HttpOnly
X-XSS-Protection: 1; mode=block
Pragma: no-cache
X-Frame-Options: SAMEORIGIN
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Content-Encoding: gzip
▶Response Body
{"access_token":"eyJhbGciOiJSUzUxMiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ1MzdVek9la2lhWVFZSDZhdlU0TFI3cHpMX0pJbXRWZ05IMnhYaDRGeUY4In0.eyJleHAiOjE2Njc3MTE2NDksImlhdCI6MTY2NzcxMTM0OSwianRpIjoiMzI5OTk3NzUtZDU4NC00YWFkLWJmYzMtZWRiN2Y3ZTM0MWM3IiwiaXNzIjoiaHR0cHM6Ly9zc28tZGV2LmFydC1pbmZvcm1hdGlxdWUuY29tL2F1dGgvcmVhbG1zL3JlY2V0dGUiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiNzBmOWEwZjMtYTBmOS00OTc2LWE1N2YtYWM3ODgwMzY2MWQwIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoic2dzT2lnbmllcyIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cHM6Ly9haXguYXJ0LWluZm9ybWF0aXF1ZS5jb20iXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJzZ3NPaWduaWVzIjp7InJvbGVzIjpbIkFQSV9BTkFMWVNFIl19LCJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6ImVtYWlsIHByb2ZpbGUiLCJjbGllbnRIb3N0IjoiOTAuOTAuMTkzLjIwMiIsImNsaWVudElkIjoic2dzT2lnbmllcyIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LXNnc29pZ25pZXMiLCJjbGllbnRBZGRyZXNzIjoiOTAuOTAuMTkzLjIwMiJ9.jX-h67I4N-eLVS_9rR06WJwrTo8mfxqGAam_fxWpCQORAZRODqxyiRbE-A_y_IF-B_Fd3BZysKJT_PSTpbtYm9KJjlKEWILxaN5emY0cSsbnBhYbQg3R-WgEpetdg7BCGz73iwPNVSxguKMmX7C5IocU8pvEyQQGz3WVijyWiMPE6-y7mRZb95Y7E7mtKTDueX2NVIn7b2UYuwWu6mu-Fyh0LV84qOpQDEbzGdk8LOBjV0jIJRLjKT30QjPd0uKQK6HCWemkQ24DePp7BK0bwKNQrFQozJZXpy_PSIK2sy0KcmFAplJIFVbe2c551FYD2P8ZJMGUgTNSHFTM1m23ew","expires_in":300,"refresh_expires_in":0,"token_type":"Bearer","not-before-policy":0,"scope":"email profile"}
Dim j As HttpJob
j.Initialize("",Me)
j.PostString("https://sso-dev.art-informatique.com/auth/realms/recette/protocol/openid-connect/token200",$"grant_type: "client_credentials""$)
j.GetRequest.SetContentType("application/x-www-form-urlencoded")
j.GetRequest.SetHeader("Authorization","Basic aaaaaa")
wait for (j) done (j As HttpJob)
If j.Success Then
Log(j.GetString)
End If
Dim granttype As String = "grant_type=client_credentials"
Dim j As HttpJob
j.Initialize("",Me)
j.PostString("https://sso-dev.art-informatique.com/auth/realms/recette/protocol/openid-connect/token",granttype)
j.GetRequest.SetContentType("application/x-www-form-urlencoded")
j.GetRequest.SetHeader("Authorization","Basic c2dzT2lnbmllczpiNjIwMzI3Yy0wNTY5LTRhMDAtOTA1Yy1iNGM3MmM5NmU0MmM=")
wait for (j) jobdone (j As HttpJob)
If j.Success Then
Log(j.GetString)
End If
j.Release
You are right, even if it's not a pre-prod, I did it, can you do you it as well in your code, please, as well as @drgottjrso this is a real api key? c2dzT2lnbmllczpiNjIwMzI3Yy0wNTY5LTRhMDAtOTA1Yy1iNGM3MmM5NmU0MmM=
uh @imbault , very bad idea to do this, you should ask for deletion of the post
Dear @EnriqueGonzalez , I sent you a "coffee"so this is a real api key?
uh @imbault , very bad idea to do this, you should ask for deletion of the post
POST https://aix.art-informatique.com/qualibase/rest/v1/analyse/integration
404
19 ms
Network
Request Headers
Authorization: Bearer eyJhbGciOiJSUzUxMiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ1MzdVek9la2lhWVFZSDZhdlU0TFI3cHpMX0pJbXRWZ05IMnhYaDRGeUY4In0.eyJleHAiOjE2Njc4NDEzNjYsImlhdCI6MTY2Nzg0MTA2NiwianRpIjoiYjU4Y2UxNzEtNjcxZC00MDI3LTk0OTktMjkxOThlMDZiMTczIiwiaXNzIjoiaHR0cHM6Ly9zc28tZGV2LmFydC1pbmZvcm1hdGlxdWUuY29tL2F1dGgvcmVhbG1zL3JlY2V0dGUiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiNzBmOWEwZjMtYTBmOS00OTc2LWE1N2YtYWM3ODgwMzY2MWQwIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoic2dzT2lnbmllcyIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cHM6Ly9haXguYXJ0LWluZm9ybWF0aXF1ZS5jb20iXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJzZ3NPaWduaWVzIjp7InJvbGVzIjpbIkFQSV9BTkFMWVNFIl19LCJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6ImVtYWlsIHByb2ZpbGUiLCJjbGllbnRIb3N0IjoiOTAuOTAuMTkzLjIwMiIsImNsaWVudElkIjoic2dzT2lnbmllcyIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LXNnc29pZ25pZXMiLCJjbGllbnRBZGRyZXNzIjoiOTAuOTAuMTkzLjIwMiJ9.TZ_lInL0F-nnLrZERA0-shD--brmMD7sJyBh6pHm8IISM-SetmqjkxuNDNXw4F9L8D52yww_OsGJf5mMVyYwA2-yZ2PX1EUAN6e69JmX3G4zl3u6RCEsBjHSYaeKARZ02M3_6PPjdRRCpmp_AMR99zKbUTTfcp3CK_XpwT4dU0mNtxZQZ6I8aOb7cR5lx2tP1wDHxkoHSdF1eXgpwUjkJF4zMmXLgD2j2G0xXTcLdNEIlrySeL-Y3BcHEpjMCPas1zLGZJm5Fy7FHQgN2nIoo-rxhYcex4cpRPl3DPHcy314cbapYzVcrCBQcyDHLUBx8iMUX1kLe3d_NjPeZ4_99Q
User-Agent: PostmanRuntime/7.29.2
Accept: */*
Cache-Control: no-cache
Postman-Token: 6bcb500a-9d44-4772-bf4c-e87f3c039c4e
Host: aix.art-informatique.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 1531
Request Body
"xml": "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Analysis laboratoryCode="Code fourni par U à chaque Prestataire." laboratoryHeadOfficeCode="Maison mère Laboratoire, code fourni par U" reportNumber="20412" sampleNumber="20412" beginDate="2022-02-23" endDate="2022-03-11" sampleDate="2022-02-11" sampleSite="Hyper U Vitry en Artois" zipCode="62490" vendorCode="Code Fournisseur" vendorSiteCode="ABSENCE" approvalNumber="N° d'agrément" ean="3256226757717" productCode="??" planificationCode="??" analysisType="ANAP" sampleType="PPC" batchNumber="3x (Lot: 2582 355.21 D1 13:47)" conclusionCode="C" specificationsRevision="Version 1" specificationsSignatureDate="2020-03-25" reportType="fullReport"><interpretation>Test Conclusion</interpretation><interpretationV2/><details><detail parameterCode="PARA001" accreditation="false" acceptanceMini="50" acceptanceMaxi="100" acceptanceText="75"><parameterName>Coton</parameterName><unit>%</unit><method>A4</method><result>1</result><uncertainty>0.02</uncertainty><conclusionCode>C</conclusionCode></detail></details></Analysis>"
Thank you! ?Dear @EnriqueGonzalez , I sent you a "coffee"
Dim body As String = $"xml=<?xml version="1.0" encoding="UTF-8" standalone="yes"?>"$
Dim j As HttpJob
j.Initialize("",Me)
j.PostString("https://aix.art-informatique.com/qualibase/rest/v1/analyse/integration",body)
j.GetRequest.SetContentType("application/x-www-form-urlencoded")
j.GetRequest.SetHeader("Authorization","Bearer eyJhbGciOiJSUzUxMiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ1Mz")
wait for (j) jobdone (j As HttpJob)
If j.Success Then
Log(j.GetString)
End If
j.Release
Thank you! ?
please try:
B4X:Dim body As String = $"xml=<?xml version="1.0" encoding="UTF-8" standalone="yes"?>"$ Dim j As HttpJob j.Initialize("",Me) j.PostString("https://aix.art-informatique.com/qualibase/rest/v1/analyse/integration",body) j.GetRequest.SetContentType("application/x-www-form-urlencoded") j.GetRequest.SetHeader("Authorization","Bearer eyJhbGciOiJSUzUxMiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ1Mz") wait for (j) jobdone (j As HttpJob) If j.Success Then Log(j.GetString) End If j.Release
{"success":false,"errors":[{"errorMessage":"Xml est obligatoire"}]}
dim m as map = CreateMap("xml": $"<?xml version="1.0" encoding... ?>"$) '<--- full xml string as in the api specs
dim jsonG as JsonGenerator
jsonG.Initialize(m)
dim body as String = jsonG.ToString
' rest of the httpjob
...
Dim m As Map
m.Initialize
m.Put("xml",$"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>"$)
Dim json As JSONGenerator
json.Initialize(m)
Dim j As HttpJob
j.Initialize("",Me)
j.PostString("https://aix.art-informatique.com/qualibase/rest/v1/analyse/integration",json.ToString)
j.GetRequest.SetContentType("application/json")
j.GetRequest.SetHeader("Authorization","Bearer eyJhbGciOiJSUzUxMiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ1Mz")
wait for (j) jobdone (j As HttpJob)
If j.Success Then
Log(j.GetString)
End If
j.Release
Dim su As StringUtils
Dim xml As String = su.EncodeUrl($"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>"$,"UTF8")
Dim body As String = $"xml=${xml}"$
Dim j As HttpJob
j.Initialize("",Me)
j.PostString("https://aix.art-informatique.com/qualibase/rest/v1/analyse/integration",body)
j.GetRequest.SetContentType("application/json")
j.GetRequest.SetHeader("Authorization","Bearer eyJhbGciOiJSUzUxMiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ1Mz")
wait for (j) jobdone (j As HttpJob)
If j.Success Then
Log(j.GetString)
End If
j.Release