dokNet.dk API


    Code example


    Henter oplysninger på enkelt respondent

    Du henter oplysninger om en respondent på adressen https://doknet.dk/api/respondent/{fid}

    Eksempel med fremmedid(fid). Hentet ved hjælp af PHP og curl

    <?php
        // The authorization token
        $authorization = "Authorization: Bearer <token>";
     
        // Parameters
        $fid = '<fid>';
     
        // Setup cURL
        $ch = curl_init('https://doknet.dk/api/respondent/' . $fid);
        curl_setopt_array($ch, array(
            CURLOPT_RETURNTRANSFER => TRUE,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', $authorization ),
        ));
     
        // Send the request
        $response = curl_exec($ch);
     
        // Check for errors
        if($response === FALSE){
            die(curl_error($ch));
        }
     
        // Print the data from the response
        echo $response . PHP_EOL;
    ?>