-
Notifications
You must be signed in to change notification settings - Fork 73
API v2 Research
Use MITMProxy, Fiddler2, Charles Proxy or whatever, install the CA certificate on your phone (Emulator or real Android phone) and make the phone connect through the proxy. Now use Snapchat. Quit SnapChat and take a look at them nice connection logs, every POST or GET request the application has ever made.
This is not for any malicious use, I just wanted to know what SnapChat does behind the application, and if anyone else is interested then here take a look.
The application makes a lot of requests to Crittercism, it sends off almost every movement performed in the application. Snapchat also has it's own "in house" analytics system, and that posts data every now to find out when you open the app.
- User-Agent :
Snapchat/8.1.1 Beta (Android SDK built for x86; Android 19; gzip)
- Accept-Language :
en
- Accept-Local :
en_US
- Content-Type :
application/x-www-form-urlencoded
- Host :
feelinsonice-hrd.appspot.com
- accept-encoding :
identity
- Content-Length
- Content-Type :
application/json; charset=UTF-8
- X-Snapchat-Notice :
Snapchat Private APIs - Unauthorized use is prohibited.
(Don't laugh please) - Vary :
accept-encoding
- Date
- Server :
Google Frontend
- Cache-Control :
no-cache, no-store
orprivate
- Alternate-Protocol :
443:quic,p=0.02
- Transfer-Encoding :
chunked
Honestly, no idea what it does.
- device_token : 162 char long string containing
- _
- random UUID maybe - username
- type :
android
is hardcoded into the APK - timestamp
- req_token
- features_map :
{}
No content.
Used to create a new user.
- birthday (YYYY-MM-DD)
- password
- age (Bit stupid seeing that you provide your birth date. Example :
22
) - timestamp
- req_token
- features_map :
{}
- should_send_text_to_verify_number : Boolean
- snapchat_phone_number :
+17864088365
- auth_token
- logged : Boolean
Allows a user to associate a username with his / her newly created account.
- username : Don't be fooled, this is your email address
- selected_username : The username you want to have
- timestamp
- req_token
- features_map :
{"all_updates_friends_response":true}
If successful then the response should be the same as/loq/all_updates
Used to request phone verification
- countryCode : ISO Country code
- action :
updatePhoneNumberWithCall
orupdatePhoneNumberWithMessage
- phoneNumber
- username
- timestamp
- req_token
- features_map :
{}
- action :
confirm
- message :
We're calling your number now with a verification code.
- param : The phone number with country code (Example :
+33102030405
) - logged : Boolean
Verification of the verification code
- action :
verifyPhoneNumber
- username
- code : 6 digit verification code
- timestamp
- req_token
- features_map :
{}
- allowed_to_use_cash :
NON_US_USER
- message :
Phone number updated!
- param : The phone number with country code (Example :
+33102030405
) - logged : Boolean
This is the greatest endpoint of them all containing most of the information, long and painful to document though...
- username
- timestamp
- req_token
- features_map :
{"all_updates_friends_response":true}
- checksums_dict : Empty variable
- background_fetch_secret_key : 44 character string containing
/ + =
- conversations_response : Array
- conversation_messages : Array
- Messages : Array
- chat_message : Array
- body : Array
- text : The message text
- type :
text
- chat_message_id : 36 character string containing
-
- header : Array
- conv_id :
ToUsername~FromUsername
- from : username
- to : Array of usernames
- conv_id :
- id : 36 character string containing
-
- seq_num : Order of display in SnapChat (Example :
5
) - timestamp : (Example :
1419936429914
) - type :
chat_message
- body : Array
- iter_token : Strange string
"{\"FromUsername\":seq_num}~{}
. This follows every chat message - snap : Array
- id : 19 character string with 18 digits then
s
orr
like before - m : Media type
- sn : Snap sender (Applicable when the snap is for you)
- rp : Snap receiver (Applicable when the snap is from you)
- st : Media state
- sts : Time sent
- t : Time viewable in seconds
- timer : Time viewable in seconds as a float
- ts : Time last interacted with
- id : 19 character string with 18 digits then
- chat_message : Array
- messaging_auth : Array
- mac : 44 character string containing
_
ending with=
- payload : 120 character string
- mac : 44 character string containing
- Messages : Array
- conversation_state : Array
- user_chat_releases : Array
- FromUsername : Array with FromUsername as key and number of snaps received from that person as key.
- user_sequences : Array with FromUsernames as key and number of snaps received from that person as key.
- user_snap_releases : Array (To be continued)
- user_chat_releases : Array
- id :
ToUsername~FromUsername
- last_chat_actions : Array
- last_write_timestamp
- last_write_type : Media type of last message (Example :
text
) - last_writer : Sender of last message
- last_interaction_ts
- last_snap :
- id : (Example :
1r
) - m : Media type
- sn : Sender name (Applicable when the snap is for you)
- rp : Recipient name (Applicable when the snap is from you)
- st : Media state
- sts : Time sent
- ts : Time of last interaction
- id : (Example :
- participants : Array of participants in the conversation
- pending_chats_for : Array of users who haven't opened the last message
- pending_received_snaps : Array
- Array
- id : Snap id
- m : Media type
- sn : Sender name (Applicable when the snap is for you)
- rp : Recipient name (Applicable when the snap is for you)
- st : Media state
- sts : Time sent
- t : Time viewable in seconds
- timer : Time viewable in seconds, but a float
- ts : Time of last interaction
- Array
- conversation_messages : Array
- conversations_response_info : Array
- is_delta : Boolean
- friends_response : Array
- added_friends : Array of friends added (To be continued)
- bests : Array of best friends (To be continued)
- friends : Array
- Array
- add_source :
ADDED_BY_USERNAME
- can_see_custom_stories : Boolean
- direction :
OUTGOING
orINCOMING
- display : User display name
- name : Username
- type : Type of friend (Example :
0
)
- add_source :
- Array
- messaging_gateway_info : Array
- gateway_auth_token : Array
- mac : 44 character string containing
-
ending with=
- payload : 72 character string ending with
=
- mac : 44 character string containing
- gateway_server : Server IP and port (Example :
23.251.149.90:443
)
- gateway_auth_token : Array
- server_info : Array
- response_checksum : Array as a string
- updates_checksum : 32 character string (MD5)
- friends_checksum : 32 character string (MD5)
- stories_checksum : 32 character string (MD5)
- conversations_checksum : 32 character string (MD5)
- response_compare_result :
equal
ornot_equal
- response_compare_results_dict : Array as a string
- updates_checksum :
equal
ornot_equal
- friends_checksum :
equal
ornot_equal
- stories_checksum :
equal
ornot_equal
- conversations_checksum :
equal
ornot_equal
- updates_checksum :
- server_latency : Ping result in ms (Example :
39
)
- response_checksum : Array as a string
- stories_response : (This part is pretty empty, haven't tried it with friends yet, gonna leave the house and find some, brb)
- friend_stories : Array (To be continued)
- friend_stories_delta : Boolean
- mature_content_text : Array
- message :
The red exclamation mark on this Story indicates that Stories posted by this user may not be suitable for sensitive viewers. Do you wish to continue? After selecting 'Yes', you will never be prompted again.
- no_text :
No
- yes_text :
Yes
- title :
Content Warning
- message :
- my_group_stories : Array (To be continued)
- my_stories : Array (To be continued)
- updates_response : Array
- added_friends_timestamp : I suppose it's the last time you added a friend. I don't have any I wouldn't know.
- allowed_to_use_cash :
NON_US_USER
(Need someone from the US to get us Snapcash details) - auth_token
- birthday : Kind reminder of your birthday (YYYY-MM-DD)
- blocked_from_using_our_story : Boolean
- can_view_mature_content : Boolean
- cash_customer_id : Username
- cash_provider :
SQUARE
- client_properties : Array
- snapcash_new_tos_accepted : Boolean
- snapcash_tos_v2_accepted : Boolean
- contacts_resync_request : (Example :
1
) - country_code : ISO 2 letter country code
- current_timestamp : A current UNIX timestamp. Thanks for that.
- device_token : Empty
- enable_video_transcoding_android : Boolean
- feature_settings : Array
- front_facing_flash : Boolean
- power_save_mode : Boolean
- replay_snaps : Boolean
- smart_filters : Boolean
- special_text : Boolean
- swipe_cash_mode : Boolean
- visual_filters : Boolean
- image_caption : Boolean
- is_cash_active : Boolean
- logged : Boolean
- mobile : Phone number with country code (Example :
+33102030405
) - mobile_verification_key : Base64 encoded string with 4 digit code and username (Example :
1234:Username
) - notification_sound_setting :
ON
orOFF
- number_of_best_friends
- received : Number of received snaps
- recents : Array containing usernames of recently interacted friends
- requests : Array (To be continued)
- score : Your snapchat score
- searchable_by_phone_number : Boolean
- sent : Number of sent snaps
- should_call_to_verify_number : Boolean
- should_send_text_to_verify_number : Boolean
- snap_p : Account privacy setting
- snapchat_phone_number : (Example :
+17864088362
) - store_privacy : Story privacy setting
- study_settings : Array
- DELTA_RESPONSE : Array as a string
- experimentId :
1
- CONVERSATIONS_DELTA :
on
oroff
- FRIENDS_STORY_DELTA :
on
oroff
- experimentId :
- USE_VIDEO_STABILIZATION : Array as a string
- experimentId :
0
- option :
on
oroff
- experimentId :
- DELTA_RESPONSE : Array as a string
- user_id : 36 character string containing
-
- username
Used to upload media to the server
- data : Encrypted image data
- media_id : Username in capitals and a random media ID
- type : Media type
- username
- req_token
- timestamp
- features_map :
{}
No content.
Used to send media to users
- time : Snap countdown timer (Float)
- recipients : Array of usernames
- media_id : The media id used when uploading the media
- zipped : (Example :
0
) - username
- req_token
- timestamp
- features_map :
{}
- snap_response : Array
- snaps : Array
- [ToUsername] : Array
- id : The snap's ID
- timestamp
- [ToUsername] : Array
- success : Boolean
- snaps : Array
Used to check for new conversations
- checksum :
- offset : [TimestampOfLastMessage]
ToUsernameFromUsername - username
- req_token
- timestamp
- features_map :
{"all_updates_friends_response":true}
- server_info : Array
- response_checksum : 32 character string (MD5)
- response_compare_result :
equal
ornot_equal
- server_latency : Ping time in ms (Example :
39
)
Informs the server and recipient that the user is typing
- recipient_usernames : Array of usernames
- username
- req_token
- timestamp
- features_map :
{}
No content.
Used to find users by phone number
- countryCode : ISO 2 letter country code
- numbers : Array with display name as key and phone number as value (The official client sends off all numbers at once. Maybe there is no limit ?)
- username
- req_token
- timestamp
- logged : Boolean
- results : Array
- Array
- display : Name provided as display name in the request
- name : Username
- type : User's privacy setting
- Array