# GetToken

To use any other method, you first need to have a token which is generated by this method. It requires the username, password and access key you have previously generated on our site .

## GetToken

<mark style="color:green;">`POST`</mark> `https://testapi.onvision.ai/wsservice.asmx`

Use this method to generate your token as JSON result.

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| user      | string | Username    |
| pwd       | string | Password    |
| AccessKey | string | Access key  |

{% tabs %}
{% tab title="200 Response when credentials are valid." %}

```javascript
{
	"Envelope": {
		"Success": "1",
		"Message": "",
		"Info": {
			"Version": "1.0.0",
			"Run_Date": "20211004214300",
			"Executed_ms": "17.044"
		},
		"Result": {
			"Token": "7b72e247-3d03-457b-872d-3fd063dbe5f5"
		}
	}
}
```

{% endtab %}
{% endtabs %}

## GetToken

<mark style="color:green;">`POST`</mark> `https://testapi.onvision.ai/wsserviceNet.asmx`

Use this method to generate your token as XML result.

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| user      | string | Username    |
| pwd       | string | Password    |
| AccessKey | string | Access key  |

{% tabs %}
{% tab title="200 Response when the credentials are valid." %}

```markup
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <GetTokenResponse xmlns="http://tempuri.org/">
            <GetTokenResult>
                <Envelope xmlns="">
                    <Success>1</Success>
                    <Message></Message>
                    <Info>
                        <Version>1.0.0</Version>
                        <Run_Date>20211004215439</Run_Date>
                        <Executed_ms>10.0214</Executed_ms>
                    </Info>
                    <Result>
                        <Token>7b72e247-3d03-457b-872d-3fd063dbe5f5</Token>
                    </Result>
                </Envelope>
            </GetTokenResult>
        </GetTokenResponse>
    </soap:Body>
</soap:Envelope>
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
This token is temporary and will expire after 48 hours
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onvision.ai/api-book/api/gettoken.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
