For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://api-doc-new.gideononline.com/gideon-api-1-0/authorization/llms.txt. For full documentation content, see https://api-doc-new.gideononline.com/gideon-api-1-0/authorization/llms-full.txt.

# /auth/login

POST https://api.gideononline.com/auth/login
Content-Type: application/json

This endpoint is used to authenticate an individual user. A succcessful login will return a unique token along with the following user information:
- user
  - user_id
  - email
  - first_name
  - last_name
- subscription
  - part_number
  - expire_date



Reference: https://api-doc-new.gideononline.com/gideon-api-1-0/authorization/auth-login

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /auth/login:
    post:
      operationId: auth-login
      summary: /auth/login
      description: >+
        This endpoint is used to authenticate an individual user. A succcessful
        login will return a unique token along with the following user
        information:

        - user
          - user_id
          - email
          - first_name
          - last_name
        - subscription
          - part_number
          - expire_date

      tags:
        - subpackage_authorization
      parameters:
        - name: email
          in: query
          required: false
          schema:
            type: string
        - name: password
          in: query
          description: md5 hashed password
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Authorization_/auth/login_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Authorization_/auth/login_Request'
servers:
  - url: https://api.gideononline.com
  - url: https://api-test.gideononline.com
components:
  schemas:
    Authorization_/auth/login_Request:
      type: object
      properties:
        email:
          type: string
          format: email
        password:
          type: string
      required:
        - email
        - password
      title: Authorization_/auth/login_Request
    AuthLoginPostResponsesContentApplicationJsonSchemaUser:
      type: object
      properties:
        email:
          type: string
          format: email
        user_id:
          type: integer
        last_name:
          type: string
        first_name:
          type: string
      required:
        - email
        - user_id
        - last_name
        - first_name
      title: AuthLoginPostResponsesContentApplicationJsonSchemaUser
    AuthLoginPostResponsesContentApplicationJsonSchemaSubscription:
      type: object
      properties:
        expire_date:
          type: string
          format: date
        part_number:
          type: integer
      required:
        - expire_date
        - part_number
      title: AuthLoginPostResponsesContentApplicationJsonSchemaSubscription
    Authorization_/auth/login_Response_200:
      type: object
      properties:
        user:
          $ref: >-
            #/components/schemas/AuthLoginPostResponsesContentApplicationJsonSchemaUser
        token:
          type: string
        subscription:
          $ref: >-
            #/components/schemas/AuthLoginPostResponsesContentApplicationJsonSchemaSubscription
      required:
        - user
        - token
        - subscription
      title: Authorization_/auth/login_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python Authorization_/auth/login_example
import requests

url = "https://api.gideononline.com/auth/login"

querystring = {"email":"Required","password":"Required"}

payload = {
    "email": "user@mydomain.com",
    "password": "password"
}
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript Authorization_/auth/login_example
const url = 'https://api.gideononline.com/auth/login?email=Required&password=Required';
const options = {
  method: 'POST',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"email":"user@mydomain.com","password":"password"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Authorization_/auth/login_example
package main

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

func main() {

	url := "https://api.gideononline.com/auth/login?email=Required&password=Required"

	payload := strings.NewReader("{\n  \"email\": \"user@mydomain.com\",\n  \"password\": \"password\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Authorization_/auth/login_example
require 'uri'
require 'net/http'

url = URI("https://api.gideononline.com/auth/login?email=Required&password=Required")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"email\": \"user@mydomain.com\",\n  \"password\": \"password\"\n}"

response = http.request(request)
puts response.read_body
```

```java Authorization_/auth/login_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.gideononline.com/auth/login?email=Required&password=Required")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"user@mydomain.com\",\n  \"password\": \"password\"\n}")
  .asString();
```

```php Authorization_/auth/login_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.gideononline.com/auth/login?email=Required&password=Required', [
  'body' => '{
  "email": "user@mydomain.com",
  "password": "password"
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Authorization_/auth/login_example
using RestSharp;

var client = new RestClient("https://api.gideononline.com/auth/login?email=Required&password=Required");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"email\": \"user@mydomain.com\",\n  \"password\": \"password\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Authorization_/auth/login_example
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "email": "user@mydomain.com",
  "password": "password"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.gideononline.com/auth/login?email=Required&password=Required")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```