Ana içeriğe atla

Endpoint

PUT /apiops/settings/geolocation/mmdb

Authentication

Requires a Personal API Access Token with admin privileges.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes
Content-Typemultipart/form-dataYes

Path Parameters

None.

Form Data

ParameterTypeRequiredDescription
filefileYesMMDB file (MaxMind GeoIP2 database file)
fileNamestringNoFile name (if not provided, uses original filename or “geolocation.mmdb”)

Notes

  • file must be a valid MMDB file
  • file must not be empty
  • fileName is optional (uses original filename if not provided)
  • MMDB file format: MaxMind GeoIP2 database format (.mmdb)

Response

Success Response (200 OK)

{
  "success": true,
  "deploymentResult": {
    "success": true,
    "message": "Deployment completed successfully",
    "environmentResults": [
      {
        "environmentName": "production",
        "success": true,
        "message": "Deployed successfully"
      }
    ]
  }
}

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "File can not be empty!"
}

Error Response (401 Unauthorized)

{
  "error": "unauthorized_client",
  "error_description": "User does not have privilege to access admin settings!"
}

cURL Example

Example 1: Upload MMDB File

curl -X PUT \
  "https://demo.apinizer.com/apiops/settings/geolocation/mmdb" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "[email protected]" \
  -F "fileName=GeoLite2-City.mmdb"

Example 2: Upload MMDB File without File Name

curl -X PUT \
  "https://demo.apinizer.com/apiops/settings/geolocation/mmdb" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "[email protected]"

Notes and Warnings

  • Admin Only:
    • This endpoint requires admin privileges
    • Only sysAdmin users can upload MMDB files
  • MMDB File Format:
    • File must be in MaxMind GeoIP2 database format (.mmdb)
    • Common files: GeoLite2-City.mmdb, GeoLite2-Country.mmdb
  • File Size:
    • Large MMDB files may take time to upload
    • Ensure sufficient storage space
  • Automatic Deployment:
    • MMDB file is automatically deployed to all environments
    • Deployment results are returned in the response
  • File Replacement:
    • Uploading a new file replaces the existing one
    • Previous file is overwritten