Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are guids?

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);

?>
like image 275
Ali Hamza Avatar asked Jul 06 '15 05:07

Ali Hamza


People also ask

What are GUIDs used for?

A GUID (globally unique identifier) is a 128-bit text string that represents an identification (ID). Organizations generate GUIDs when a unique reference number is needed to identify information on a computer or network. A GUID can be used to ID hardware, software, accounts, documents and other items.

How are GUIDs generated?

Basically, a a GUID is generated using a combination of: The MAC address of the machine used to generate the GUID (so GUIDs generated on different machines are unique unless MAC addresses are re-used) Timestamp (so GUIDs generated at different times on the same machine are unique)

What is GUID example?

Types of GUIDs To identify the version of the GUID, just look at the version digit e.g version 4 GUIDs have the format xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx where N is one of 8,9,A, or B. This version is generated using both the current time and client MAC address.

What is a GUID in computer?

A globally unique identifier or GUID is a special type of identifier used in software applications to provide a unique reference number. The value is represented as a 32-character hexadecimal string, such as. {21EC2020-3AEA-1069-A2DD-08002B30309D}, and is usually stored as a 128-bit integer.


1 Answers

  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
like image 72
Igor Savinkin Avatar answered Nov 06 '22 20:11

Igor Savinkin