---
# System prepended metadata

title: App

---

# App

## JWT Authorization<br>
ruby example:
```ruby
secret_key = 'd0e611c90bf43d2e4083'
exp = 3.minute.from_now.to_i # 3 minute time expiration
args = {
  merchant_id: 'WesLjLV6',
  exp: 1660788927
}
jw_token = JWT.encode(args, secret_key, 'HS512')
# => "eyJhbGciOiJIUzUxMiJ9.eyJtZXJjaGFudF9pZCI6Ildlc0xqTFY2IiwiZXhwIjoxNjYwNzg4OTI3fQ.RWvEBsvL8f0jyGKqIyvRMB1oY3qqkZmepMYhS8kNwEaEg3yY0xciGO3RlrNwN-s1W3Zjk_XrUIoxFCsYQcNQdw"
token = Base64.urlsafe_encode64(jw_token)
# => "ZXlKaGJHY2lPaUpJVXpVeE1pSjkuZXlKdFpYSmphR0Z1ZEY5cFpDSTZJbGRsYzB4cVRGWTJJaXdpWlhod0lqb3hOall3TnpnNE9USTNmUS5SV3ZFQnN2TDhmMGp5R0txSXl2Uk1CMW9ZM3Fxa1ptZXBNWWhTOGtOd0VhRWczeVkweGNpR08zUmxyTndOLXMxVzNaamtfWHJVSW94RkNzWVFjTlFkdw=="
```

## Get Bearer Token

**Endpoint**: `app/token/new`<br>
**Method**: `GET`<br>
**Content-Type**: `application/json`<br>
**Request Parameters**:
| Parameter | Type | Optional | Value | Description |
| - | - | - | - | - |
| exp | Integer | false | 1660788927 | within 3 mins |
| token | String | false | ZXlKaGJHY2l... | |

**Request Example**:
```bash
curl --location --request GET 'example.com/app/token/new' \
--header 'Content-Type: application/json' \
--data-raw '{
    "exp": 1660788927,
    "token": "ZXlKaGJHY2lPaUpJVXpVeE1pSjkuZXlKdFpYSmphR0Z1ZEY5cFpDSTZJbGRsYzB4cVRGWTJJaXdpWlhod0lqb3hOall3TnpnNE9USTNmUS5SV3ZFQnN2TDhmMGp5R0txSXl2Uk1CMW9ZM3Fxa1ptZXBNWWhTOGtOd0VhRWczeVkweGNpR08zUmxyTndOLXMxVzNaamtfWHJVSW94RkNzWVFjTlFkdw=="
}'
```

**Response**:
```json
{
  "exp": 1661349455,
  "token": "ZXlKaGJHY2lPaUpJVXpVeE1pSjkuZXlKbGVIQWlPakUyTmpFek5EazBOVFY5Lk5SYklCUnlzUm5reFI1WERyZnZ3THZDZmFQVUNBUVM1ZHI3NEdldjN5bjdhaVFnQUkwYXVRUmpDa1NOa240by11UHFJdFY5aTNOX3FQYlZ0OFJrUlN3"
}
```

# BraveTroops



