Loading...

APi Documentation

Well detailed API documentation for GOCode

Authentication

All API requests require authentication using a Bearer token in the Authorization header.

Authorization: Bearer SECRET_KEY

1. Create QR Code

Endpoint: POST /user-api/create-qr-code

Request Parameters:

  • url (string, required) - The URL to encode.
  • type (string, required) - Type of QR code (static or dynamic).

Response:

{ "message": "You have successfully created a QR code", "data": "data:image/svg+xml;base64,QR_CODE_DATA" }

2. Update QR Code

Endpoint: POST /user-api/update-qr-code

Request Parameters:

  • id (integer, required) - ID of the QR code.
  • url (string, required) - New URL to encode.

Response:

{ "message": "You have successfully updated a QR code", "data": "data:image/svg+xml;base64,QR_CODE_DATA" }

3. Get QR Code

Endpoint: GET /user-api/qr/{id}

Response:

{ "id": 1, "qr_code": "data:image/svg+xml;base64,QR_CODE_DATA" }

4. Get QR Codes by Type

Endpoint: GET /user-api/qrs/{type?}

Optional Parameter:

  • type (string, optional) - Filter by static, dynamic or all.

Response:

{
            "current_page": 1,
            "data": [
              {
                "id": 1,
                "qr_code": "data:image/svg+xml;base64,QR_CODE_DATA",
                ...
              },
              {
                "id": 2,
                "qr_code": "data:image/svg+xml;base64,QR_CODE_DATA",
                ...
              }
            ],
            "first_page_url": "https://user-api/qrs/{type?}?page=1",
            "last_page": 5,
            "last_page_url": "https://user-api/qrs/{type?}?page=5",
            "next_page_url": "https://user-api/qrs/{type?}?page=2",
            "prev_page_url": null,
            "per_page": 10,
            "total": 50
          }