Skip to main content

Usage

To send a voice note with Arnio:
  1. Upload the .caf file to a public storage bucket so Arnio can fetch it.
  2. Make sure the file format is .caf (Core Audio File), as this is the only format Apple supports for inline iMessage voice notes.
  3. Pass the file’s public URL as the media_url in your API request.
curl -X POST https://api.arnio.co/messages/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+15555555555",
    "body": "Check out this voice note 🎤",
    "media_url": "https://your-public-bucket.s3.amazonaws.com/voicenote.caf"
  }'

Response

  • The response will be the same as a regular outbound message. The only difference is the media_url will be the URL of the voice note you uploaded.

Troubleshooting

Often times, it is desirable to convert the audio file from another format, such as MP3. This can be done using the ffmpeg library, and requires the codec to be set as opus or libopus Here’s an example of how to convert an MP3 file to a .caf file:
ffmpeg -i input.mp3 -acodec opus -b:a 24k output.caf