Skip to content

aravindnatch/imessage-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imessage-api

A simple imessage api that leverages applescript and a local webserver to send iMessage or SMS messages (including files) programmatically. Runs persistently in the macOS menubar.

Notes

Due to limitations imposed by apple, all features are not accessible to machines running macOS 10.16 or higher. All macOS versions can send imessages/sms to new or existing conversations.

Sending a Message

In order to send a message, you will need to use the API Key that is auto generated by the app on first launch. In order to access it, you will need to click the 'copy api key' option in the menu bar app.

import requests

# set the request parameters
json = {
  'apikey': 'YOUR_API_KEY'
  'number': 'XXXXXXXXXX', # can also be an iMessage enabled email
  'service': 'iMessage', # can also be set to 'SMS'
  'message': 'hello from imessage-api!',
  'isFile': 'false'
}

# make the request to the local server
req = requests.post('http://localhost:33229/sendMessage', json=json)

# print the response
print(req.text) # {"status":"success","time":"2022-09-26 22:24:54"}

Run/Build Locally

# clone the repository
git clone https://github.com/aravindnatch/imessage-api.git

# install the dependencies
pip install -r requirements.txt

# run the app locally
python3 main.py

# build the app locally
python3 setup.py py2app # saved to: dist/imessage-api.app

About

an easy to use imessage api packaged into a macos menubar app

Topics

Resources

License

Stars

Watchers

Forks

Contributors