Skip to content

Oauth2

Login

GET https://api.stretch.com/api/v1/gateway/auth/login

Code sample

curl -X GET \
  --url "https://api.stretch.com/api/v1/gateway/auth/login" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests

headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

try:
    response = requests.get("https://api.stretch.com/api/v1/gateway/auth/login, headers=headers")
    print(response.json())
except requests.exceptions.HTTPError as errh:
    print("HTTP Error:", errh)
except requests.exceptions.RequestException as errex:
    print("Exception request:", errex)
<?php

$url = "https://api.stretch.com/api/v1/gateway/auth/login";
$headers = array(
    "Content-Type: application/json",
    "Authorization: Bearer YOUR_ACCESS_TOKEN",
);



$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    $error_msg = curl_error($ch);
    echo "Exception request: " . $error_msg;
} else {
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) {
        echo "HTTP Error: " . curl_getinfo($ch, CURLINFO_HTTP_CODE);
    } else {
        echo $response;
    }
}

curl_close($ch);
?>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        String url = "https://api.stretch.com/api/v1/gateway/auth/login";
        String accessToken = "YOUR_ACCESS_TOKEN";

        try {
            URL apiUrl = new URL(url);
            HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
            connection.setRequestMethod("GET");
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestProperty("Authorization", "Bearer " + accessToken);

            int responseCode = connection.getResponseCode();

            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder content = new StringBuilder();
                while ((inputLine = in.readLine()) != null) {
                    content.append(inputLine);
                }
                in.close();
                System.out.println(content.toString());
            } else {
                System.out.println("HTTP Error: " + responseCode);
            }
            connection.disconnect();
        } catch (MalformedURLException e) {
            System.out.println("Exception request: " + e.getMessage());
        } catch (IOException e) {
            System.out.println("Exception request: " + e.getMessage());
        }
    }
}
require 'net/http'
require 'uri'
require 'json'

url = 'https://api.stretch.com/api/v1/gateway/auth/login'
access_token = 'YOUR_ACCESS_TOKEN'

uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => "Bearer #{access_token}"
}

begin
  request = Net::HTTP::Get.new(uri.request_uri, headers)
  response = http.request(request)

  if response.code.to_i == 200
    puts JSON.parse(response.body)
  else
    puts "HTTP Error: #{response.code}"
  end
rescue => e
  puts "Exception request: #{e.message}"
end
const axios = require('axios');

const url = 'https://api.stretch.com/api/v1/gateway/auth/login';
const headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
};

axios
  .get(url,{ headers })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    if (error.response) {
      console.log('HTTP Error:', error.response.status);
    } else {
      console.log('Exception request:', error.message);
    }
  });
using System;
using System.Net.Http;

async Task Main() {
  using(var client = new HttpClient()) {
    client.DefaultRequestHeaders.Add("Content-Type", "application/json");var response = await client.GetAsync(new Uri("https://api.stretch.com/api/v1/gateway/auth/login")

    if (response.IsSuccessStatusCode) {
      var content = await response.Content.ReadAsStringAsync();
      Console.WriteLine(content);
    } else {
      Console.WriteLine($"Request failed with status code: {(int)response.StatusCode}");
    }
  }
}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://api.stretch.com/api/v1/gateway/auth/login"
    accessToken := "YOUR_ACCESS_TOKEN"

    client := &http.Client{}
    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("Authorization", "Bearer "+accessToken)

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }
    defer resp.Body.Close()

    if resp.StatusCode == http.StatusOK {
        body, err := ioutil.ReadAll(resp.Body)
        if err != nil {
            fmt.Println("Exception request:", err)
            return
        }
        fmt.Println(string(body))
    } else {
        fmt.Println("HTTP Error:", resp.StatusCode)
    }
}
import 'dart:convert';
import 'package:http/http.dart' as http;

void main() async {
  final url = 'https://api.stretch.com/api/v1/gateway/auth/login';
  final accessToken = 'YOUR_ACCESS_TOKEN';

  final headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer $accessToken',
  };

  try {final response = await http.get(Uri.parse(url), headers: headers);
    if (response.statusCode == 200) {
      print(jsonDecode(response.body));
    } else {
      print('HTTP Error: ${response.statusCode}');
    }
  } catch (e) {
    print('Exception request: $e');
  }
}
Response

ErrorResponse

{
    "code": 400
    "error": "gateway_auth_wrong_redirect_url"
    "message": "Wrong redirect url or not set"
}

ErrorResponse:

error string

message string

code integer

HTTPValidationError

{
    "detail": []
}

Login Post

POST https://api.stretch.com/api/v1/gateway/auth/login

Input Fields / Form-Data / JSON

Query Parameter Type Description Example
redirect_url string
grant_type string
username required string
password required string
scope string
client_id string
client_secret string

Code sample

curl -X POST \
  --url "https://api.stretch.com/api/v1/gateway/auth/login" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests

headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

try:
    response = requests.post("https://api.stretch.com/api/v1/gateway/auth/login, headers=headers")
    print(response.json())
except requests.exceptions.HTTPError as errh:
    print("HTTP Error:", errh)
except requests.exceptions.RequestException as errex:
    print("Exception request:", errex)
<?php

$url = "https://api.stretch.com/api/v1/gateway/auth/login";
$headers = array(
    "Content-Type: application/x-www-form-urlencoded",
    "Authorization: Bearer YOUR_ACCESS_TOKEN",
);



$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    $error_msg = curl_error($ch);
    echo "Exception request: " . $error_msg;
} else {
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) {
        echo "HTTP Error: " . curl_getinfo($ch, CURLINFO_HTTP_CODE);
    } else {
        echo $response;
    }
}

curl_close($ch);
?>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        String url = "https://api.stretch.com/api/v1/gateway/auth/login";
        String accessToken = "YOUR_ACCESS_TOKEN";

        try {
            URL apiUrl = new URL(url);
            HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            connection.setRequestProperty("Authorization", "Bearer " + accessToken);

            int responseCode = connection.getResponseCode();

            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder content = new StringBuilder();
                while ((inputLine = in.readLine()) != null) {
                    content.append(inputLine);
                }
                in.close();
                System.out.println(content.toString());
            } else {
                System.out.println("HTTP Error: " + responseCode);
            }
            connection.disconnect();
        } catch (MalformedURLException e) {
            System.out.println("Exception request: " + e.getMessage());
        } catch (IOException e) {
            System.out.println("Exception request: " + e.getMessage());
        }
    }
}
require 'net/http'
require 'uri'
require 'json'

url = 'https://api.stretch.com/api/v1/gateway/auth/login'
access_token = 'YOUR_ACCESS_TOKEN'

uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

headers = {
  'Content-Type' => 'application/x-www-form-urlencoded',
  'Authorization' => "Bearer #{access_token}"
}

begin
  request = Net::HTTP::Post.new(uri.request_uri, headers)
  response = http.request(request)

  if response.code.to_i == 200
    puts JSON.parse(response.body)
  else
    puts "HTTP Error: #{response.code}"
  end
rescue => e
  puts "Exception request: #{e.message}"
end
const axios = require('axios');

const url = 'https://api.stretch.com/api/v1/gateway/auth/login';
const headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
};

axios
  .post(url,{ headers })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    if (error.response) {
      console.log('HTTP Error:', error.response.status);
    } else {
      console.log('Exception request:', error.message);
    }
  });
using System;
using System.Net.Http;

async Task Main() {
  using(var client = new HttpClient()) {
    client.DefaultRequestHeaders.Add("Content-Type", "application/x-www-form-urlencoded");var response = await client.PostAsync(new Uri("https://api.stretch.com/api/v1/gateway/auth/login")

    if (response.IsSuccessStatusCode) {
      var content = await response.Content.ReadAsStringAsync();
      Console.WriteLine(content);
    } else {
      Console.WriteLine($"Request failed with status code: {(int)response.StatusCode}");
    }
  }
}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://api.stretch.com/api/v1/gateway/auth/login"
    accessToken := "YOUR_ACCESS_TOKEN"

    client := &http.Client{}
    req, err := http.NewRequest("POST", url, nil)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }

    req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
    req.Header.Add("Authorization", "Bearer "+accessToken)

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }
    defer resp.Body.Close()

    if resp.StatusCode == http.StatusOK {
        body, err := ioutil.ReadAll(resp.Body)
        if err != nil {
            fmt.Println("Exception request:", err)
            return
        }
        fmt.Println(string(body))
    } else {
        fmt.Println("HTTP Error:", resp.StatusCode)
    }
}
import 'dart:convert';
import 'package:http/http.dart' as http;

void main() async {
  final url = 'https://api.stretch.com/api/v1/gateway/auth/login';
  final accessToken = 'YOUR_ACCESS_TOKEN';

  final headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Bearer $accessToken',
  };

  try {final response = await http.post(Uri.parse(url), headers: headers);
    if (response.statusCode == 200) {
      print(jsonDecode(response.body));
    } else {
      print('HTTP Error: ${response.statusCode}');
    }
  } catch (e) {
    print('Exception request: $e');
  }
}
Response

HTTPValidationError

{
    "detail": []
}

Login Password

POST https://api.stretch.com/api/v1/gateway/auth/login/password

Input Fields / Form-Data / JSON

Query Parameter Type Description Example
username string
timezone string
redirect_url string
client_id string (uuid)

Code sample

curl -X POST \
  --url "https://api.stretch.com/api/v1/gateway/auth/login/password" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests

headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

try:
    response = requests.post("https://api.stretch.com/api/v1/gateway/auth/login/password, headers=headers")
    print(response.json())
except requests.exceptions.HTTPError as errh:
    print("HTTP Error:", errh)
except requests.exceptions.RequestException as errex:
    print("Exception request:", errex)
<?php

$url = "https://api.stretch.com/api/v1/gateway/auth/login/password";
$headers = array(
    "Content-Type: application/x-www-form-urlencoded",
    "Authorization: Bearer YOUR_ACCESS_TOKEN",
);



$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    $error_msg = curl_error($ch);
    echo "Exception request: " . $error_msg;
} else {
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) {
        echo "HTTP Error: " . curl_getinfo($ch, CURLINFO_HTTP_CODE);
    } else {
        echo $response;
    }
}

curl_close($ch);
?>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        String url = "https://api.stretch.com/api/v1/gateway/auth/login/password";
        String accessToken = "YOUR_ACCESS_TOKEN";

        try {
            URL apiUrl = new URL(url);
            HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            connection.setRequestProperty("Authorization", "Bearer " + accessToken);

            int responseCode = connection.getResponseCode();

            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder content = new StringBuilder();
                while ((inputLine = in.readLine()) != null) {
                    content.append(inputLine);
                }
                in.close();
                System.out.println(content.toString());
            } else {
                System.out.println("HTTP Error: " + responseCode);
            }
            connection.disconnect();
        } catch (MalformedURLException e) {
            System.out.println("Exception request: " + e.getMessage());
        } catch (IOException e) {
            System.out.println("Exception request: " + e.getMessage());
        }
    }
}
require 'net/http'
require 'uri'
require 'json'

url = 'https://api.stretch.com/api/v1/gateway/auth/login/password'
access_token = 'YOUR_ACCESS_TOKEN'

uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

headers = {
  'Content-Type' => 'application/x-www-form-urlencoded',
  'Authorization' => "Bearer #{access_token}"
}

begin
  request = Net::HTTP::Post.new(uri.request_uri, headers)
  response = http.request(request)

  if response.code.to_i == 200
    puts JSON.parse(response.body)
  else
    puts "HTTP Error: #{response.code}"
  end
rescue => e
  puts "Exception request: #{e.message}"
end
const axios = require('axios');

const url = 'https://api.stretch.com/api/v1/gateway/auth/login/password';
const headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
};

axios
  .post(url,{ headers })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    if (error.response) {
      console.log('HTTP Error:', error.response.status);
    } else {
      console.log('Exception request:', error.message);
    }
  });
using System;
using System.Net.Http;

async Task Main() {
  using(var client = new HttpClient()) {
    client.DefaultRequestHeaders.Add("Content-Type", "application/x-www-form-urlencoded");var response = await client.PostAsync(new Uri("https://api.stretch.com/api/v1/gateway/auth/login/password")

    if (response.IsSuccessStatusCode) {
      var content = await response.Content.ReadAsStringAsync();
      Console.WriteLine(content);
    } else {
      Console.WriteLine($"Request failed with status code: {(int)response.StatusCode}");
    }
  }
}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://api.stretch.com/api/v1/gateway/auth/login/password"
    accessToken := "YOUR_ACCESS_TOKEN"

    client := &http.Client{}
    req, err := http.NewRequest("POST", url, nil)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }

    req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
    req.Header.Add("Authorization", "Bearer "+accessToken)

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }
    defer resp.Body.Close()

    if resp.StatusCode == http.StatusOK {
        body, err := ioutil.ReadAll(resp.Body)
        if err != nil {
            fmt.Println("Exception request:", err)
            return
        }
        fmt.Println(string(body))
    } else {
        fmt.Println("HTTP Error:", resp.StatusCode)
    }
}
import 'dart:convert';
import 'package:http/http.dart' as http;

void main() async {
  final url = 'https://api.stretch.com/api/v1/gateway/auth/login/password';
  final accessToken = 'YOUR_ACCESS_TOKEN';

  final headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Bearer $accessToken',
  };

  try {final response = await http.post(Uri.parse(url), headers: headers);
    if (response.statusCode == 200) {
      print(jsonDecode(response.body));
    } else {
      print('HTTP Error: ${response.statusCode}');
    }
  } catch (e) {
    print('Exception request: $e');
  }
}
Response

HTTPValidationError

{
    "detail": []
}

Signup

GET https://api.stretch.com/api/v1/gateway/auth/signup

Code sample

curl -X GET \
  --url "https://api.stretch.com/api/v1/gateway/auth/signup" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests

headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

try:
    response = requests.get("https://api.stretch.com/api/v1/gateway/auth/signup, headers=headers")
    print(response.json())
except requests.exceptions.HTTPError as errh:
    print("HTTP Error:", errh)
except requests.exceptions.RequestException as errex:
    print("Exception request:", errex)
<?php

$url = "https://api.stretch.com/api/v1/gateway/auth/signup";
$headers = array(
    "Content-Type: application/json",
    "Authorization: Bearer YOUR_ACCESS_TOKEN",
);



$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    $error_msg = curl_error($ch);
    echo "Exception request: " . $error_msg;
} else {
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) {
        echo "HTTP Error: " . curl_getinfo($ch, CURLINFO_HTTP_CODE);
    } else {
        echo $response;
    }
}

curl_close($ch);
?>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        String url = "https://api.stretch.com/api/v1/gateway/auth/signup";
        String accessToken = "YOUR_ACCESS_TOKEN";

        try {
            URL apiUrl = new URL(url);
            HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
            connection.setRequestMethod("GET");
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestProperty("Authorization", "Bearer " + accessToken);

            int responseCode = connection.getResponseCode();

            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder content = new StringBuilder();
                while ((inputLine = in.readLine()) != null) {
                    content.append(inputLine);
                }
                in.close();
                System.out.println(content.toString());
            } else {
                System.out.println("HTTP Error: " + responseCode);
            }
            connection.disconnect();
        } catch (MalformedURLException e) {
            System.out.println("Exception request: " + e.getMessage());
        } catch (IOException e) {
            System.out.println("Exception request: " + e.getMessage());
        }
    }
}
require 'net/http'
require 'uri'
require 'json'

url = 'https://api.stretch.com/api/v1/gateway/auth/signup'
access_token = 'YOUR_ACCESS_TOKEN'

uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => "Bearer #{access_token}"
}

begin
  request = Net::HTTP::Get.new(uri.request_uri, headers)
  response = http.request(request)

  if response.code.to_i == 200
    puts JSON.parse(response.body)
  else
    puts "HTTP Error: #{response.code}"
  end
rescue => e
  puts "Exception request: #{e.message}"
end
const axios = require('axios');

const url = 'https://api.stretch.com/api/v1/gateway/auth/signup';
const headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
};

axios
  .get(url,{ headers })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    if (error.response) {
      console.log('HTTP Error:', error.response.status);
    } else {
      console.log('Exception request:', error.message);
    }
  });
using System;
using System.Net.Http;

async Task Main() {
  using(var client = new HttpClient()) {
    client.DefaultRequestHeaders.Add("Content-Type", "application/json");var response = await client.GetAsync(new Uri("https://api.stretch.com/api/v1/gateway/auth/signup")

    if (response.IsSuccessStatusCode) {
      var content = await response.Content.ReadAsStringAsync();
      Console.WriteLine(content);
    } else {
      Console.WriteLine($"Request failed with status code: {(int)response.StatusCode}");
    }
  }
}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://api.stretch.com/api/v1/gateway/auth/signup"
    accessToken := "YOUR_ACCESS_TOKEN"

    client := &http.Client{}
    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("Authorization", "Bearer "+accessToken)

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }
    defer resp.Body.Close()

    if resp.StatusCode == http.StatusOK {
        body, err := ioutil.ReadAll(resp.Body)
        if err != nil {
            fmt.Println("Exception request:", err)
            return
        }
        fmt.Println(string(body))
    } else {
        fmt.Println("HTTP Error:", resp.StatusCode)
    }
}
import 'dart:convert';
import 'package:http/http.dart' as http;

void main() async {
  final url = 'https://api.stretch.com/api/v1/gateway/auth/signup';
  final accessToken = 'YOUR_ACCESS_TOKEN';

  final headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer $accessToken',
  };

  try {final response = await http.get(Uri.parse(url), headers: headers);
    if (response.statusCode == 200) {
      print(jsonDecode(response.body));
    } else {
      print('HTTP Error: ${response.statusCode}');
    }
  } catch (e) {
    print('Exception request: $e');
  }
}
Response

HTTPValidationError

{
    "detail": []
}

Signup Post

POST https://api.stretch.com/api/v1/gateway/auth/signup

Input Fields / Form-Data / JSON

Query Parameter Type Description Example
redirect_url string
client_id string (uuid)
sid string
code string

Code sample

curl -X POST \
  --url "https://api.stretch.com/api/v1/gateway/auth/signup" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests

headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

try:
    response = requests.post("https://api.stretch.com/api/v1/gateway/auth/signup, headers=headers")
    print(response.json())
except requests.exceptions.HTTPError as errh:
    print("HTTP Error:", errh)
except requests.exceptions.RequestException as errex:
    print("Exception request:", errex)
<?php

$url = "https://api.stretch.com/api/v1/gateway/auth/signup";
$headers = array(
    "Content-Type: application/x-www-form-urlencoded",
    "Authorization: Bearer YOUR_ACCESS_TOKEN",
);



$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    $error_msg = curl_error($ch);
    echo "Exception request: " . $error_msg;
} else {
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) {
        echo "HTTP Error: " . curl_getinfo($ch, CURLINFO_HTTP_CODE);
    } else {
        echo $response;
    }
}

curl_close($ch);
?>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        String url = "https://api.stretch.com/api/v1/gateway/auth/signup";
        String accessToken = "YOUR_ACCESS_TOKEN";

        try {
            URL apiUrl = new URL(url);
            HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            connection.setRequestProperty("Authorization", "Bearer " + accessToken);

            int responseCode = connection.getResponseCode();

            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder content = new StringBuilder();
                while ((inputLine = in.readLine()) != null) {
                    content.append(inputLine);
                }
                in.close();
                System.out.println(content.toString());
            } else {
                System.out.println("HTTP Error: " + responseCode);
            }
            connection.disconnect();
        } catch (MalformedURLException e) {
            System.out.println("Exception request: " + e.getMessage());
        } catch (IOException e) {
            System.out.println("Exception request: " + e.getMessage());
        }
    }
}
require 'net/http'
require 'uri'
require 'json'

url = 'https://api.stretch.com/api/v1/gateway/auth/signup'
access_token = 'YOUR_ACCESS_TOKEN'

uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

headers = {
  'Content-Type' => 'application/x-www-form-urlencoded',
  'Authorization' => "Bearer #{access_token}"
}

begin
  request = Net::HTTP::Post.new(uri.request_uri, headers)
  response = http.request(request)

  if response.code.to_i == 200
    puts JSON.parse(response.body)
  else
    puts "HTTP Error: #{response.code}"
  end
rescue => e
  puts "Exception request: #{e.message}"
end
const axios = require('axios');

const url = 'https://api.stretch.com/api/v1/gateway/auth/signup';
const headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
};

axios
  .post(url,{ headers })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    if (error.response) {
      console.log('HTTP Error:', error.response.status);
    } else {
      console.log('Exception request:', error.message);
    }
  });
using System;
using System.Net.Http;

async Task Main() {
  using(var client = new HttpClient()) {
    client.DefaultRequestHeaders.Add("Content-Type", "application/x-www-form-urlencoded");var response = await client.PostAsync(new Uri("https://api.stretch.com/api/v1/gateway/auth/signup")

    if (response.IsSuccessStatusCode) {
      var content = await response.Content.ReadAsStringAsync();
      Console.WriteLine(content);
    } else {
      Console.WriteLine($"Request failed with status code: {(int)response.StatusCode}");
    }
  }
}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://api.stretch.com/api/v1/gateway/auth/signup"
    accessToken := "YOUR_ACCESS_TOKEN"

    client := &http.Client{}
    req, err := http.NewRequest("POST", url, nil)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }

    req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
    req.Header.Add("Authorization", "Bearer "+accessToken)

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }
    defer resp.Body.Close()

    if resp.StatusCode == http.StatusOK {
        body, err := ioutil.ReadAll(resp.Body)
        if err != nil {
            fmt.Println("Exception request:", err)
            return
        }
        fmt.Println(string(body))
    } else {
        fmt.Println("HTTP Error:", resp.StatusCode)
    }
}
import 'dart:convert';
import 'package:http/http.dart' as http;

void main() async {
  final url = 'https://api.stretch.com/api/v1/gateway/auth/signup';
  final accessToken = 'YOUR_ACCESS_TOKEN';

  final headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Bearer $accessToken',
  };

  try {final response = await http.post(Uri.parse(url), headers: headers);
    if (response.statusCode == 200) {
      print(jsonDecode(response.body));
    } else {
      print('HTTP Error: ${response.statusCode}');
    }
  } catch (e) {
    print('Exception request: $e');
  }
}
Response

HTTPValidationError

{
    "detail": []
}

Signup Post Complete

POST https://api.stretch.com/api/v1/gateway/auth/complete

Input Fields / Form-Data / JSON

Query Parameter Type Description Example
redirect_url string
client_id string (uuid)
username string
email string
password string
password_again string

Code sample

curl -X POST \
  --url "https://api.stretch.com/api/v1/gateway/auth/complete" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests

headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

try:
    response = requests.post("https://api.stretch.com/api/v1/gateway/auth/complete, headers=headers")
    print(response.json())
except requests.exceptions.HTTPError as errh:
    print("HTTP Error:", errh)
except requests.exceptions.RequestException as errex:
    print("Exception request:", errex)
<?php

$url = "https://api.stretch.com/api/v1/gateway/auth/complete";
$headers = array(
    "Content-Type: application/x-www-form-urlencoded",
    "Authorization: Bearer YOUR_ACCESS_TOKEN",
);



$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    $error_msg = curl_error($ch);
    echo "Exception request: " . $error_msg;
} else {
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) {
        echo "HTTP Error: " . curl_getinfo($ch, CURLINFO_HTTP_CODE);
    } else {
        echo $response;
    }
}

curl_close($ch);
?>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        String url = "https://api.stretch.com/api/v1/gateway/auth/complete";
        String accessToken = "YOUR_ACCESS_TOKEN";

        try {
            URL apiUrl = new URL(url);
            HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            connection.setRequestProperty("Authorization", "Bearer " + accessToken);

            int responseCode = connection.getResponseCode();

            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder content = new StringBuilder();
                while ((inputLine = in.readLine()) != null) {
                    content.append(inputLine);
                }
                in.close();
                System.out.println(content.toString());
            } else {
                System.out.println("HTTP Error: " + responseCode);
            }
            connection.disconnect();
        } catch (MalformedURLException e) {
            System.out.println("Exception request: " + e.getMessage());
        } catch (IOException e) {
            System.out.println("Exception request: " + e.getMessage());
        }
    }
}
require 'net/http'
require 'uri'
require 'json'

url = 'https://api.stretch.com/api/v1/gateway/auth/complete'
access_token = 'YOUR_ACCESS_TOKEN'

uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

headers = {
  'Content-Type' => 'application/x-www-form-urlencoded',
  'Authorization' => "Bearer #{access_token}"
}

begin
  request = Net::HTTP::Post.new(uri.request_uri, headers)
  response = http.request(request)

  if response.code.to_i == 200
    puts JSON.parse(response.body)
  else
    puts "HTTP Error: #{response.code}"
  end
rescue => e
  puts "Exception request: #{e.message}"
end
const axios = require('axios');

const url = 'https://api.stretch.com/api/v1/gateway/auth/complete';
const headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
};

axios
  .post(url,{ headers })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    if (error.response) {
      console.log('HTTP Error:', error.response.status);
    } else {
      console.log('Exception request:', error.message);
    }
  });
using System;
using System.Net.Http;

async Task Main() {
  using(var client = new HttpClient()) {
    client.DefaultRequestHeaders.Add("Content-Type", "application/x-www-form-urlencoded");var response = await client.PostAsync(new Uri("https://api.stretch.com/api/v1/gateway/auth/complete")

    if (response.IsSuccessStatusCode) {
      var content = await response.Content.ReadAsStringAsync();
      Console.WriteLine(content);
    } else {
      Console.WriteLine($"Request failed with status code: {(int)response.StatusCode}");
    }
  }
}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://api.stretch.com/api/v1/gateway/auth/complete"
    accessToken := "YOUR_ACCESS_TOKEN"

    client := &http.Client{}
    req, err := http.NewRequest("POST", url, nil)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }

    req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
    req.Header.Add("Authorization", "Bearer "+accessToken)

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Exception request:", err)
        return
    }
    defer resp.Body.Close()

    if resp.StatusCode == http.StatusOK {
        body, err := ioutil.ReadAll(resp.Body)
        if err != nil {
            fmt.Println("Exception request:", err)
            return
        }
        fmt.Println(string(body))
    } else {
        fmt.Println("HTTP Error:", resp.StatusCode)
    }
}
import 'dart:convert';
import 'package:http/http.dart' as http;

void main() async {
  final url = 'https://api.stretch.com/api/v1/gateway/auth/complete';
  final accessToken = 'YOUR_ACCESS_TOKEN';

  final headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Bearer $accessToken',
  };

  try {final response = await http.post(Uri.parse(url), headers: headers);
    if (response.statusCode == 200) {
      print(jsonDecode(response.body));
    } else {
      print('HTTP Error: ${response.statusCode}');
    }
  } catch (e) {
    print('Exception request: $e');
  }
}
Response

HTTPValidationError

{
    "detail": []
}