1Sub.dev

Developer API

As a developer you can register and unregister subscriptions to you by using the API. You need to have an API key; if not, please generate some random bytes, hash it with sha256 and send the hash to us. There are currently two API endpoints: subscribe and unsubscribe.

All calls are sent as POST and the parameters are encoded like form data (form-urlencoded without the plus encoding). The server responds with HTTP 200 status code if the action was successful.


Subscribe

URL: https://1sub.dev/api/subscribe

Subscribes specified account to you. Remember to keep track of how many subscriptions you have left to sell by checking the `credits` response value (divide by 100).

Request parameters:

callerYour account number that will be subscribed to
apikeyUnhashed API key
accountAccount number that will subscribe

Response parameters:

creditsThe number of credits on your account after this action
subscribersThe number of subscribers you have after this action

Example command:
curl https://1sub.dev/api/subscribe -d 'caller=a.123&apikey=somethingsecret&account=a.456'


Unsubscribe

URL: https://1sub.dev/api/unsubscribe

Unsubscribes specified account from you.

Request parameters:

callerYour account number that is subscribed to
apikeyUnhashed API key
accountAccount number that will unsubscribe

Response parameters:

creditsThe number of credits on your account after this action
subscribersThe number of subscribers you have after this action

Example command:
curl https://1sub.dev/api/unsubscribe -d 'caller=a.123&apikey=somethingsecret&account=a.456'


Info

URL: https://1sub.dev/api/info

Shows information about your account. Makes no changes.

Request parameters:

callerYour account number
apikeyUnhashed API key

Response parameters:

creditsThe number of credits on your account
subscribersThe number of subscribers you have

Example command:
curl https://1sub.dev/api/info -d 'caller=a.123&apikey=somethingsecret'