Skip to content
moxon home

Encode

The /encode endpoint encodes or decodes text in various formats.

gethttps://api.moxon.dev/v5/encode
Try itget/v5/encode

Parameters

  • methodstringrequired

    Encoding method (see available methods below)

    • base64encode
    • base64decode
    • urlencode
    • urldecode
    • morse
    • unmorse
    • rot13
    • caesar
    • binary
    • unbinary
  • textstringrequired

    Text to encode or decode

  • shiftnumberoptional

    Shift value for Caesar cipher (default: 13)

Available Methods

MethodDescription
base64encodeEncode to Base64
base64decodeDecode from Base64
urlencodeURL encode
urldecodeURL decode
morseText to Morse code
unmorseMorse code to Text
rot13ROT-13 cipher
caesarCaesar cipher (requires shift)
binaryText to 8-bit binary
unbinaryBinary to Text

Response Fields

  • methodstring

    The encoding method used

  • resultstring

    The encoded or decoded output

Code Examples

Error Handling

If parameters are missing or invalid, the API will return an error:

  • 400A value is requiredThe text parameter is missing
  • 400Please provide a valid method (?method={base64encode|base64decode|morse|…})The method parameter is missing or invalid
  • 400Invalid Base64 inputThe text is not valid Base64 (for base64decode)
  • 400Invalid Morse codeThe text is not valid Morse code (for unmorse)
  • 400Invalid binary inputThe text is not valid binary (for unbinary)
  • 400Please provide a valid shift valueThe shift value is missing or invalid (for caesar)