Git Product home page Git Product logo

Comments (3)

curato2 avatar curato2 commented on June 3, 2024

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.

arslandixeam avatar arslandixeam commented on June 3, 2024

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.

arslandixeam avatar arslandixeam commented on June 3, 2024

@curato2 can u plz help me.
Thanks

from cwa-quicktest-onboarding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.