Skip to content
ToolsOnDuty - free online tools
ToolsOnDuty / docs
Browse documentation

Reference / Mobile Developer

Mobile Developer API

8 endpoints for mobile developer workflows. Every call requires bearer authentication and uses the standard ToolsOnDuty response envelope.

Try it

Runs a real request from your browser to your own ToolsOnDuty account. Your key is only kept in this page and is never stored.

POST/v1/mobile/json-swift1 credit / call

JSON to Swift Codable

Generate Swift Codable structs from a JSON document.

ParameterTypeRequiredDescription
jsonstringYesJSON text.
rootNamestringNoName for the root struct. Default: Root.

Request

curl -X POST https://toolsonduty.com/api/v1/mobile/json-swift \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"json":"{\"id\":1,\"name\":\"a\"}"}'

Response

{
  "ok": true,
  "data": {
    "result": "struct Root: Codable {\n    let id: Int\n    let name: String\n}"
  }
}
POST/v1/mobile/json-kotlin1 credit / call

JSON to Kotlin data class

Generate Kotlin data classes from a JSON document.

ParameterTypeRequiredDescription
jsonstringYesJSON text.
rootNamestringNoName for the root data class. Default: Root.

Request

curl -X POST https://toolsonduty.com/api/v1/mobile/json-kotlin \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"json":"{\"id\":1,\"name\":\"a\"}"}'

Response

{
  "ok": true,
  "data": {
    "result": "data class Root(\n    val id: Int,\n    val name: String\n)"
  }
}
POST/v1/mobile/color-to-mobile1 credit / call

Hex color to mobile code

Convert a hex color to SwiftUI, UIKit, Jetpack Compose and Android XML color code.

ParameterTypeRequiredDescription
hexstringYesHex color, e.g. #6495ed.
alphanumberNoOpacity (0-1). Default: 1.

Request

curl -X POST https://toolsonduty.com/api/v1/mobile/color-to-mobile \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"hex":"#6495ed"}'

Response

{
  "ok": true,
  "data": {
    "swiftUI": "Color(red: 0.392, green: 0.584, blue: 0.929, opacity: 1)"
  }
}
POST/v1/mobile/semver1 credit / call

Semantic version tool

Parse, bump (major/minor/patch) or compare semantic versions.

ParameterTypeRequiredDescription
modestringNoparse | bump | compare. Default: parse.
versionstringYesA semantic version, e.g. 1.2.3.
levelstringNomode=bump: major | minor | patch. Default: patch.
compareTostringNomode=compare: the version to compare against.

Request

curl -X POST https://toolsonduty.com/api/v1/mobile/semver \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"mode":"bump","version":"1.2.3","level":"minor"}'

Response

{
  "ok": true,
  "data": {
    "result": "1.3.0"
  }
}
POST/v1/mobile/bundle-id1 credit / call

Bundle ID / package name validator

Validate an iOS bundle identifier or Android package name.

ParameterTypeRequiredDescription
idstringYesBundle ID or package name, e.g. com.example.app.
platformstringYesandroid | ios.

Request

curl -X POST https://toolsonduty.com/api/v1/mobile/bundle-id \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"id":"com.example.app","platform":"ios"}'

Response

{
  "ok": true,
  "data": {
    "valid": true,
    "segments": 3,
    "errors": []
  }
}
POST/v1/mobile/push-payload1 credit / call

Push notification payload validator

Validate an FCM or APNs push notification payload for common structural issues.

ParameterTypeRequiredDescription
payloadstringYesJSON push payload.
platformstringYesfcm | apns.

Request

curl -X POST https://toolsonduty.com/api/v1/mobile/push-payload \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"payload":"{\"aps\":{\"alert\":\"Hi\"}}","platform":"apns"}'

Response

{
  "ok": true,
  "data": {
    "valid": true,
    "errors": [],
    "warnings": []
  }
}
POST/v1/mobile/screen-density1 credit / call

Screen density converter

Convert a dp/pt value to pixels across every Android density bucket and iOS @1x/@2x/@3x scale.

ParameterTypeRequiredDescription
valuenumberYesA dp (Android) or pt (iOS) value.

Request

curl -X POST https://toolsonduty.com/api/v1/mobile/screen-density \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"value":16}'

Response

{
  "ok": true,
  "data": {
    "android": [
      {
        "name": "mdpi",
        "dpi": 160,
        "px": 16
      }
    ],
    "ios": [
      {
        "name": "@2x",
        "px": 32
      }
    ]
  }
}
POST/v1/mobile/ios-strings1 credit / call

iOS .strings <-> JSON

Convert an iOS Localizable.strings file to JSON, or JSON key/value pairs back to .strings format.

ParameterTypeRequiredDescription
textstringYesmode=to-json: .strings text. mode=to-strings: JSON text.
modestringNoto-json | to-strings. Default: to-json.

Request

curl -X POST https://toolsonduty.com/api/v1/mobile/ios-strings \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"text":"\"hello\" = \"Hello\";","mode":"to-json"}'

Response

{
  "ok": true,
  "data": {
    "result": "{\n  \"hello\": \"Hello\"\n}"
  }
}