ScratchOn API Documentation

Registration

POST http://lottoassist.com/register

Headers:

Content-Type: application/json

Body:

{ "email": "your_email@example.com", "password": "your_password", "device_id": "unique_device_identifier", "state_abbr": "SC" }

Example curl request:

curl -X POST 'http://lottoassist.com/register' \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "password": "secure_password", "device_id": "12345-abcde-67890-fghij", "state_abbr": "SC" }'

Successful Response:

{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "user_id": "7343d289-33d7-11ef-9123-f24f7ec218ff" }

Authentication

POST http://lottoassist.com/auth

Headers:

Content-Type: application/json

Body:

{ "username": "your_email@example.com", "password": "your_password", "device_id": "unique_device_identifier", "state_abbr": "SC" }

Example curl request:

curl -X POST 'http://lottoassist.com/auth' \ -H "Content-Type: application/json" \ -d '{ "username": "user@example.com", "password": "secure_password", "device_id": "12345-abcde-67890-fghij", "state_abbr": "SC" }'

Successful Response:

{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "user_id": "7343d289-33d7-11ef-9123-f24f7ec218ff" }

Making Authenticated Requests

After obtaining the token, you can make requests to protected endpoints. You must include the token in the X-AUTH header of each request.

Get Best Odds

GET http://lottoassist.com/best-odds/<user_id>

Headers:

X-AUTH: <your_token> Content-Type: application/json

Example curl request:

curl -X GET 'http://lottoassist.com/best-odds/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Get Jackpots Trending Up

GET http://lottoassist.com/jackpots-trending-up/<user_id>

Example curl request:

curl -X GET 'http://lottoassist.com/jackpots-trending-up/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Get Most Jackpots Remaining

GET http://lottoassist.com/most-jackpots-remaining/<user_id>

Example curl request:

curl -X GET 'http://lottoassist.com/most-jackpots-remaining/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Get Big Wins by Best Odds

GET http://lottoassist.com/big-wins-best-odds/<user_id>

Example curl request:

curl -X GET 'http://lottoassist.com/big-wins-best-odds/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Get Big Wins Trending Up

GET http://lottoassist.com/big-wins-trending-up/<user_id>

Example curl request:

curl -X GET 'http://lottoassist.com/big-wins-trending-up/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Get Best Big Win Tickets

GET http://lottoassist.com/best-big-win-tickets/<user_id>

Example curl request:

curl -X GET 'http://lottoassist.com/best-big-win-tickets/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Get Any Win by Best Odds by Prize

GET http://lottoassist.com/any-win-best-odds-prize/<user_id>

Example curl request:

curl -X GET 'http://lottoassist.com/any-win-best-odds-prize/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Get Any Win Trending Up

GET http://lottoassist.com/any-win-trending-up/<user_id>

Example curl request:

curl -X GET 'http://lottoassist.com/any-win-trending-up/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Get Any Win by Best Odds by Ticket

GET http://lottoassist.com/any-win-best-odds-ticket/<user_id>

Example curl request:

curl -X GET 'http://lottoassist.com/any-win-best-odds-ticket/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Get Cards by Highest Outstanding Value vs Cost

GET http://lottoassist.com/cards-highest-value-vs-cost/<user_id>

Example curl request:

curl -X GET 'http://lottoassist.com/cards-highest-value-vs-cost/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"

Error Handling

If the token is missing, expired, or invalid, you'll receive a 403 Forbidden response:

{ "message": "Token is missing!" }

or

{ "message": "Token is invalid or expired!" }

Step-by-Step Guide

  1. Register a new user:

    Use the /register endpoint to create a new user account. You'll receive a token and user_id upon successful registration.

  2. Authenticate:

    If you're an existing user or need to refresh your token, use the /auth endpoint to obtain a new token.

  3. Make authenticated requests:

    Use the token received from registration or authentication in the X-AUTH header for all subsequent requests to protected endpoints.

Example workflow:

  1. Register a new user: curl -X POST 'http://lottoassist.com/register' \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "password": "secure_password", "device_id": "12345-abcde-67890-fghij", "state_abbr": "SC" }'
  2. Use the received token to make an authenticated request: curl -X GET 'http://lottoassist.com/best-odds/7343d289-33d7-11ef-9123-f24f7ec218ff' \ -H "X-AUTH: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json"
  3. Repeat step 2 for other endpoints as needed, always including the X-AUTH header with your token.

Remember to replace the example user_id and token with your actual values in all requests.