-
Notifications
You must be signed in to change notification settings - Fork 30
Home
-
blob_enc_key
The encryption key -
pattern
The pattern for creating the hash -
secret
An secret for creating the hash -
static_token
Static token for initial login and register. -
hostname
API hostname (So you can do debuging) -
user_agent
The user agent.
return a req_token. First param is typically the auth_token. Second param is typically the timestamp.
Make a post call and sign it with a req_token.
-
endpoint
The endpoint to call eg:'/ph/login'
-
post_data
Data -
param1
Usually the auth_token -
param2
Usually the timestamp -
raw
If true, return a stream instead of a string. The stream will be paused to avoid data loss
username
password
Returns a promise of sync_data
###register(String username, String email, String password) Register an account. On success, it will return sync data.
username
email
password
Get current state and optionally update it
username
auth_token
-
json
An object optionally containing fields to update.
The current state
Fetch a blob
username
auth_token
-
id
The blob's id (This is a number followedr
)
Returns a promise of a paused stream.
Upload an blob
username
auth_token
-
blob
A Readable stream of an image or video to upload. (The official app can view jpeg and pngs images; and mp4 video. It cannot view gifs. [possibly more]) -
isVideo
Set this totrue
if you are uploading a video.
Returns a promise of the blob's media_id
send(String username, String auth_token, String mediaId, Array(String) recipients, Number time=undefined)
Send the snap to people
username
auth_token
-
mediaId
The blobs's media_id -
friends
A list of people to send the snap to. -
time
How long (in seconds) a snap should be visible. This should only be set if the snap is a picture.
###addFriend(String username, String auth_token, String friend) Add a friend
username
auth_token
-
friend
The username of your soon-to-be friend
###rename(String username, String auth_token, String friend, String newName)
Set a friend's display
name.
username
auth_token
-
friend
The friend to rename. -
newName
Their new display name.
###unfriend(String username, String auth_token, String friend) Remove a friend.
username
auth_token
-
friend
The friend to remove
Update your privacy setting
username
auth_token
-
onlyFriends
Iftrue
, only friends can send you snaps.
Change your email
username
auth_token
-
email
Your new email