> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mygigsters.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify OTP

> This route returns the JWT for use with API Keys routes (/api-keys/) - note that the OTP is always 123456 for non-production environments

### Request Body

**otp** `string` *required*

One Time Pin to be sent in string format

**email** `string` *required*

The email address which you requested the OTP for

### Responses

| Code | Description |
| - | - |
| `200` | Response with the JWT to use for the rest of the API Keys routes |
| `400` | Missing info in request body |
| `404` | Cannot find user or invalid OTP |

### Response fields

**message** `string`

Information about response

**clientId** `integer`

Client ID of the user

**email** `string`

Email of user

**token** `string`

JWT for use with API Keys routes

> [accordion] Error response fields
>
> **errors** `string`
>
> Information about missing data

```bash cURL theme={null}
curl 'https://qa-super.mygigsters.com.au/auth/verify-otp' -X POST \
         -H "Content-Type: application/json" --data '{"otp":"123456","email":"email@email.com"}'
```

```javascript Node.js theme={null}
const response = await fetch("https://qa-super.mygigsters.com.au/auth/verify-otp", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "otp": "123456",
    "email": "email@email.com"
  }),
});

const data = await response.json();
console.log(data);
```

```python Python theme={null}
import requests

response = requests.post(
    "https://qa-super.mygigsters.com.au/auth/verify-otp",
    json={
        "otp": "123456",
        "email": "email@email.com",
    },
)

print(response.json())
```

```ruby Ruby theme={null}
require "net/http"
require "json"
require "uri"

uri = URI("https://qa-super.mygigsters.com.au/auth/verify-otp")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request.body = <<~JSON
  {
    "otp": "123456",
    "email": "email@email.com"
  }
JSON

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts JSON.parse(response.body)
```

```php PHP theme={null}
<?php

$ch = curl_init("https://qa-super.mygigsters.com.au/auth/verify-otp");

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "otp": "123456",
  "email": "email@email.com"
}
JSON,
]);

$response = curl_exec($ch);
curl_close($ch);

print_r(json_decode($response, true));
```

```java Java theme={null}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        String body = String.join("\n",
            "{",
            "  \"otp\": \"123456\",",
            "  \"email\": \"email@email.com\"",
            "}"
        );

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://qa-super.mygigsters.com.au/auth/verify-otp"))
            .header("Content-Type", "application/json")
            .method("POST", HttpRequest.BodyPublishers.ofString(body))
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());

        System.out.println(response.body());
    }
}
```

```go Go theme={null}
package main

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

func main() {
	body := strings.NewReader(`{
  "otp": "123456",
  "email": "email@email.com"
}`)

	req, err := http.NewRequest("POST", "https://qa-super.mygigsters.com.au/auth/verify-otp", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, _ := io.ReadAll(res.Body)
	fmt.Println(string(data))
}
```

```csharp .NET theme={null}
using System.Net.Http.Headers;
using System.Text;

using var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Post, "https://qa-super.mygigsters.com.au/auth/verify-otp");
request.Content = new StringContent(@"{
  ""otp"": ""123456"",
  ""email"": ""email@email.com""
}", Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

```json 200 theme={null}
{
  "message": "OTP verified successfully",
  "clientId": 1,
  "email": "idea@woodevelopment.com",
  "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEsImV4cCI6MTc2NjQ0MDg3MiwiaWF0IjoxNzY2NDM3MjcyfQ.N5z-MpfLZqwUrD1Cc0Kj2ciZ9i66I5SIDH0C8daFpkcX_VNcZ_I8ZgW_GLTAnwWjdY_J1e7T7FcwPxxK3MwN9_G5vUIuSRlqzVw87NHhZLS6yIL41wSQ2oJjT0esFO8V7FjakiPuU4qc5duXYWyfeqX8faYzxsD4j0o1L7GqoEHqoaVp-RkOXdPSTmveZI7HqdzqXPgRcLprY3E8Bd59JX5oM8ynf8SKy5GOWSh4VsIhOTZsVO9CPhzBPglTUona1ZpWU9JtwRnwI3LxycuosUvwmJJ8w-bGPhUazRcKmRevE1e29nvqNWPa0RH3f4uneSnS4GYJh3APCvblpwWeHBvtvpAXT84RkWv0dKr5QAZh3wFVGvOcLpIwPP0MXwDNYeZTkR_l_tIRUzSeU56H2hC5kj_X5emR-p76mwnY9dIfYZax3aSxMPeHgyTchR3DQUok-DIZvGLoGE731E1Sqc2eC1itjNjaBqsr_DcwPapXljtI01pCrIZ9TXkH4XgyrCtSrFps9uviv28_GMzIgJcJ6J7PTLpdrOGtY3LWe7bKGksTwe2LkQb-Oj2HyUr7GMMOFhw7wMUz_mrUjJ2pJjFi1XrNEwzApx9UJw1dDC7GiQTxJPH9SvL_re6zH0qK99OtKAU9gCczdMkQ29tBGT0HJrpWDyb62E8j9y5C-EU"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.