Ana içeriğe geç

Upload MMDB File

Endpoint

PUT /apiops/settings/geolocation/mmdb

Authentication

Requires a Personal API Access Token with system admin access (sysAdmin or ADMIN authority).

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typemultipart/form-dataYes

Path Parameters

None.

Form Data

ParameterTypeRequiredDescription
filefileYesMMDB file (MaxMind GeoIP2 database file)
fileNamestringNoDisplay file name. When omitted, uses the uploaded file original name, or geolocation.mmdb as fallback

Notes

  • file must not be empty
  • fileName is sent as a multipart form part (not a query parameter)
  • Uploading a new file replaces the existing MMDB in the setting record
  • MMDB file format: MaxMind GeoIP2 database (.mmdb)

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"deploymentResult": {
"success": true,
"responseTime": 1500,
"detailList": [
{
"envName": "production",
"success": true,
"detail": "Deployed successfully",
"responseTime": 450
}
]
}
}

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "File can not be empty!"
}

or (non-admin user with valid token)

{
"status": "FAILURE",
"resultMessage": "Unauthorized! Only users with ADMIN role can access this resource!"
}

Error Response (401 Unauthorized)

Invalid or missing API token.

{
"status": "FAILURE",
"resultMessage": "User not found!"
}

cURL Example

Example 1: Upload MMDB File

curl -X PUT \
"https://demo.apinizer.com/apiops/settings/geolocation/mmdb" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@GeoLite2-City.mmdb" \
-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 "file=@GeoLite2-City.mmdb"

Permissions

User must have system admin (sysAdmin) or ADMIN authority. See Geolocation API.

Notes and Warnings

  • System admin only:

    • Not a project-scoped endpoint
    • Regular project permissions do not apply
  • MMDB file format:

    • File must be in MaxMind GeoIP2 database format (.mmdb)
    • Common files: GeoLite2-City.mmdb, GeoLite2-Country.mmdb
  • Automatic deployment:

    • MMDB is deployed to Gateway environments after upload
    • Deployment results are returned in deploymentResult.detailList
  • File replacement:

    • Uploading a new file overwrites the previous MMDB stored in the setting