Retrieving User Details
π€ Get User Details API
Our Get User Details API allows you to fetch detailed information about a user associated with a given user identifier.
By using the following sample code, you can retrieve the details (remaining minutes, email, etc.) of a given user:
import requests
url = "https://api.transkriptor.com/5/Get-User-Details"
#your api key
apiKey = "xxxxx"
parameters = {
"apiKey" : apiKey
}
response = requests.get(url, params = parameters)
print(response.text)
const axios = require('axios');
const url = 'https://api.transkriptor.com/5/Get-User-Details';
const apiKey = 'xxxxx';
const parameters = {
apiKey: apiKey
};
axios.get(url, { params: parameters })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
import java.io.IOException;
import java.net.URL;
import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper;
public class Main {
public static void main(String[] args) throws IOException {
String url = "https://api.transkriptor.com/5/Get-User-Details";
String apiKey = "xxxxx";
Map<String, String> parameters = Map.of("apiKey", apiKey);
URL requestUrl = new URL(url + "?" + encodeParams(parameters));
String response = new String(requestUrl.openStream().readAllBytes());
System.out.println(response);
}
private static String encodeParams(Map<String, String> params) throws IOException {
StringBuilder result = new StringBuilder();
for (Map.Entry<String, String> entry : params.entrySet()) {
if (result.length() > 0) {
result.append("&");
}
result.append(URLEncoder.encode(entry.getKey(), "UTF-8"));
result.append("=");
result.append(URLEncoder.encode(entry.getValue(), "UTF-8"));
}
return result.toString();
}
}
using System;
using System.Net;
using Newtonsoft.Json;
class Program
{
static void Main()
{
string url = "https://api.transkriptor.com/5/Get-User-Details";
string apiKey = "xxxxx";
using (WebClient client = new WebClient())
{
client.QueryString.Add("apiKey", apiKey);
string response = client.DownloadString(url);
Console.WriteLine(response);
}
}
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.transkriptor.com/5/Get-User-Details"
parameters := map[string]string{
"apiKey": "xxxxx",
}
res, err := http.Get(url + "?" + encodeParams(parameters))
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
func encodeParams(params map[string]string) string {
values := make([]string, 0, len(params))
for key, value := range params {
values = append(values, fmt.Sprintf("%s=%s", key, value))
}
return strings.Join(values, "&")
}
require 'net/http'
require 'json'
url = URI.parse('https://api.transkriptor.com/5/Get-User-Details')
parameters = { 'apiKey' => 'xxxxx' }
url.query = URI.encode_www_form(parameters)
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
response = http.get(url)
puts response.body
<?php
$url = "https://api.transkriptor.com/5/Get-User-Details";
$apiKey = "xxxxx";
$parameters = array(
"apiKey" => $apiKey
);
$response = file_get_contents($url . '?' . http_build_query($parameters));
echo $response;
?>
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
fun main() {
val url = "https://api.transkriptor.com/5/Get-User-Details"
val apiKey = "xxxxx"
val requestUrl = url + "?apiKey=$apiKey"
val client = OkHttpClient()
val request = Request.Builder()
.url(requestUrl)
.build()
val response: Response = client.newCall(request).execute()
println(response.body()?.string())
}
import Foundation
let url = URL(string: "https://api.transkriptor.com/5/Get-User-Details")!
let apiKey = "xxxxx"
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.setValue(apiKey, forHTTPHeaderField: "apiKey")
let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
if let error = error {
print("Error: \(error.localizedDescription)")
return
}
if let data = data {
if let str = String(data: data, encoding: .utf8) {
print(str)
}
}
}
task.resume()
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
final url = Uri.parse('https://api.transkriptor.com/5/Get-User-Details');
final apiKey = 'xxxxx';
final headers = {
'apiKey': apiKey,
};
final response = await http.get(url, headers: headers);
print(response.body);
}
Updated over 1 year ago