Comments (3)
Wir haben es in PHP mit einem curl POST Request gelöst damit funktioniert die Weitergabe wunderbar - das ist die einfachste Implementierung gewesen, das mitgelieferte Package aus der openAPI.json ist unvollständig und für uns unbrauchbar...
`if($status=="negativ"){
$result = 6;
}
elseif($status=="positiv"){
$result = 7;
}
else{
$result = 8;
}
$array=array();
$array["testResults"]=array();
$array["testResults"][]=array("id"=>$warnapp_hash,"result"=>$result);
$payload = json_encode($array);
$url = "https://quicktest-result-cff4f7147260.coronawarn.app/api/v1/quicktest/results";
$cert = "xxx.pem";
$certkey="xxx.key";
//open connection
$ch = curl_init();
//set options
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSLCERT, $cert);
curl_setopt($ch, CURLOPT_SSLKEY, $certkey);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, '');
curl_setopt($ch, CURLOPT_SSLKEYPASSWD, 'xxx');
curl_setopt ($ch, CURLOPT_VERBOSE , 0);
//execute post
curl_exec($ch);
//close connection
curl_close($ch);`
from cwa-quicktest-onboarding.
hello,
i am using the given request in php, but i am getting 400 error.
<?php
$url = "https://quicktest-result-cff4f7147260.coronawarn.app?v=1#eyAiZm4iOiAiRXJpa2EiLCAibG4iOiAiTXVzdGVybWFubiIsICJkb2IiOiAiMTk5MC0xMi0yMyIsICJ0aW1lc3RhbXAiOiAxNjE4Mzg2NTQ4LCAidGVzdGlkIjogIjUyY2RkZDhlLWZmMzItNDQ3OC1hZjY0LWNiODY3Y2VhMWRiNSIsICJzYWx0IjogIjc1OUY4RkYzNTU0RjBFMUJCRjZFRkY4REUyOThEOUU5IiwgImhhc2giOiAiNjdhNTBjYmE1OTUyYmY0ZjZjN2VjYTg5NmMwMDMwNTE2YWIyZjIyOGYxNTcyMzc3MTJlNTJkNjY0ODlkOTk2MCIgfQ";
$cert = __DIR__ ."/output.crt";
$certkey= __DIR__ .'/ctc-wru.key';
//open connection
$ch = curl_init();
//set options
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSLCERT, $cert);
curl_setopt($ch, CURLOPT_SSLKEY, $certkey);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, '');
curl_setopt($ch, CURLOPT_SSLKEYPASSWD, 'xxxxxx');
curl_setopt ($ch, CURLOPT_VERBOSE , 0);
//execute post
$result = curl_exec($ch);
if (curl_errno($ch)) {
$error_msg = curl_error($ch);
}
//close connection
curl_close($ch);
print_r($error_msg);
echo '<br>';
print_r($result);exit;
Here is my code.
output.crt file is provided by the cornawarn-app server.
ctc-wru.key is the generated by ubuntu (as mentioned in the wiki) (Link : https://github.com/corona-warn-app/cwa-quicktest-onboarding/wiki/Anbindung-der-Partnersysteme)
Can anybody tell me where i am making mistake.
Thanks.
from cwa-quicktest-onboarding.
@curato2 can u plz help me.
Thanks
from cwa-quicktest-onboarding.
Related Issues (20)
- SSL certificate problem: self signed certificate in certificate chain HOT 1
- You need help generating the CovPassCheckApp compatible QR-Code from the partialDcc ? HOT 2
- Be aware: Python example contains bugs on timestamps
- Cryptografic strong random bytes generation for DGC request HOT 1
- create-client-csr.sh not working HOT 4
- [email protected] no reaction HOT 3
- 403 on sending test result [WRU] [/api/v1/quicktest/results] HOT 19
- 403 on sending test result [PROD] [/api/v1/quicktest/results]
- Missing labId parameter in QuickTestResultList model
- Links at the bottom of the wiki do not work HOT 1
- PHP DCC Implementierung HOT 1
- PHP ohne DCC: unable to set private key file: 'my-wru.key' type PEM HOT 1
- Testergebnis erfolgreich eingestellt, aber App sagt "Ergebnis liegt noch nicht vor" HOT 2
- Be aware: CWA and DCC use "fn" in different ways
- I 'd like someone to help me urgently. HOT 1
- dcc php examlpe: Undefined variable: jsonArrayResponse
- DCC endpoint returns status code 400 with valid WRU certificate
- Still got "unable to set private key file" after doing:
- Umstieg von Testsystem auf Produktiv
- Wiki-Seite Aktualität?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cwa-quicktest-onboarding.