Use GET /user as a read-only connectivity check.
GET
/userReturn the current accountcurl --fail-with-body \ "https://api.ltesocks.io/v2/user" \ -H "Accept: application/json" \ -H "Authorization: Bearer ${LTESOCKS_API_TOKEN}"A successful response is a JSON user object. Exact fields are listed in the API reference.
Official SDK
Section titled “Official SDK”import { LTESocksClient } from '@ltesocks/sdk';
const client = LTESocksClient.withBearerToken( process.env.LTESOCKS_API_TOKEN, { language: 'en' },);const user = await client.user.get();
console.log(user.login);import os
from ltesocks_sdk import Client
with Client.with_bearer_token( os.environ["LTESOCKS_API_TOKEN"], language="en",) as client: user = client.user.get() print(user.login)<?php
use LTESocks\Client;
require __DIR__ . '/vendor/autoload.php';
$client = Client::builder() ->withBearerToken((string) getenv('LTESOCKS_API_TOKEN')) ->withLanguage('en') ->build();$user = $client->user()->get();
echo $user->getLogin();Verify the integration
Section titled “Verify the integration”Check these conditions before continuing:
- DNS and TLS connect to
api.ltesocks.io. - The response status is in the
2xxrange. - The response
Content-Typeis JSON. - The returned account is the account you intended to automate.
- Logs do not contain the bearer token.
Discover before ordering
Section titled “Discover before ordering”Do not hard-code plan, server, or signature identifiers from examples. Request current values:
curl "https://api.ltesocks.io/v2/plans" \ -H "Authorization: Bearer ${LTESOCKS_API_TOKEN}"
curl "https://api.ltesocks.io/v2/servers" \ -H "Authorization: Bearer ${LTESOCKS_API_TOKEN}"
curl "https://api.ltesocks.io/v2/signatures" \ -H "Authorization: Bearer ${LTESOCKS_API_TOKEN}"The same discovery calls through an official SDK:
const plans = await client.general.listPlans();const servers = await client.general.listServers();const signatures = await client.general.listSignatures();plans = client.general.list_plans()servers = client.general.list_servers()signatures = client.general.list_signatures()<?php
$plans = $client->general()->listPlans();$servers = $client->general()->listServers();$signatures = $client->general()->listSignatures();Then follow Order a mobile port.