5

HI there can you please tell me that what are connector-guid, user-guid and api key in below given code and how to get them for any website?

<pre>
<?php

$userGuid = "8f65f01f-c6bc-42a4-914d-879efd159abd";
$apiKey = "private";

// Issues a query request to import.io
function query($connectorGuid, $input, $userGuid, $apiKey) {

    $url = "https://query.import.io/store/connector/" . $connectorGuid . "/_query?_user=" . urlencode($userGuid) . "&_apikey=" . urlencode($apiKey);

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        "Content-Type: application/json",
        "import-io-client: import.io PHP client",
        "import-io-client-version: 2.0.0"
    ));
    curl_setopt($ch, CURLOPT_POSTFIELDS,  json_encode(array("input" => $input)));
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    $result = curl_exec($ch);
    curl_close($ch);

    return json_decode($result);
}

// Query for tile Curs Banca Comerciala Feroviara
$result = query("7d00ba0e-947c-403f-b33b-886a7ee2a300", array(
  "webpage/url" => "http://www.bfer.ro/ro/curs-valutar/",
), $userGuid, $apiKey, false);
var_dump($result);

?>
1
  • Not quite sure what you are asking. From the looks of your code, it's something assigned by the website you are accessing... which means the method to obtain one would be different depending on the service.
    – Jon
    Commented Jul 6, 2015 at 5:34

2 Answers 2

8
  1. User-guid is a your import.io user unique identificator. You might see it at your user's settings' page.
  2. Connector-guid is a unique identifier for each connector in general sence, it might be a connector, a crawler, an extractor. It's issued for each api connector automatically. You might get it for each api piece. See the data page. Below is an example of crawler with the connector-guid (in a white box): enter image description here
  3. API key is your unique key to all your api. It's renewable (you might generate a new one). Just enter your account page, get to the API key line and input your password to unlock api key. Read more here how to get an api key. account page with api Unlocked api key: Unlocked api key
0
0

Not sure but here is what i think. I think connectorGuid is some random key used to create the link to the web api.
The apiKey is obviously the api key.
userGuid again is some identification of records
All web apis are not the same so you cant get api details of any website

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.