Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Registering a new account through api #141

Closed
seesoe opened this issue Jun 29, 2015 · 5 comments
Closed

Registering a new account through api #141

seesoe opened this issue Jun 29, 2015 · 5 comments

Comments

@seesoe
Copy link

seesoe commented Jun 29, 2015

I'm having some trouble getting an account fully registered through the api.

firstly I was able to get things rolling by making the following changes.
moved hunk 462-491 to under line 397
https://github.com/mgp25/SC-API/blob/master/src/snapchat_agent.php#L462

casted the first $jsonResult as object on this line
https://github.com/mgp25/SC-API/blob/master/src/snapchat_agent.php#L428

added if empty array check before this foreach loop
https://github.com/mgp25/SC-API/blob/master/src/snapchat.php#L1236

when I try

$result = $snapchat->sendCaptcha('000111110', 'mysnapusername~1435617404564');
REQUEST TO: https://sc-analytics.appspot.com/post_events
DATA: {"common_params":{"user_id":"e770f49b7ca9a855e883a91e0effe26b57b0bcc82d46e1b6294d38f7037a6f69","city":"Unimplemented","sc_user_agent":"Snapchat\/9.10.0.0 (HTC One; Android 4.4.2#302626.7#19; gzip)","session_id":"00000000-0000-0000-0000-000000000000","region":"Unimplemented","latlon":"Unimplemented","friend_count":-1,"country":"Unimplemented"},"events":[{"event_name":"APP_OPEN","event_timestamp":1435617750198,"event_params":{"open_state":"NORMAL","intent_action":"null"}}],"batch_id":"f8c741f6-02b9-0003-0000-2bef9b70b308-Snapchat91000HTCOneAndroid442302626719gzip1435617750198"}

There was an error registering your account
Error code: 400
BAD_REQUEST
@mgp25
Copy link
Owner

mgp25 commented Jul 1, 2015

@seesoe i'll check tomorrow this

@hako
Copy link
Collaborator

hako commented Jul 22, 2015

@mgp25 I sniffed the register process and heres the dump of /loq/register

/loq/register

headers

POST /loq/register HTTP/1.1

Accept-Language : en
Accept-Locale : en_GB
User-Agent : Snapchat/9.12.3.0 Beta (Nexus 5; Android 5.1.1#1863243#22; gzip)
X-Snapchat-Client-Auth-Token : Bearer <REDACTED>
Content-Type : application/x-www-form-urlencoded; charset=UTF-8
Content-Length : 6574
Host : feelinsonice-hrd.appspot.com
Connection : Keep-Alive
Accept-Encoding : gzip

params

age 26
attestation   <REDACTED>
birthday    1989-07-22
dsig    <REDACTED>
dtoken1i    <REDACTED>
email   sgdhhsjskabfbc
password    sgbsnqndnsndndh
req_token   <REDACTED>
timestamp   1437553542689

response

{
    "username_suggestions": ["sgdhhsjskabfbc5", "sgdhhsjskabfbc7"],
    "email": "[email protected]",
    "should_send_text_to_verify_number": false,
    "snapchat_phone_number": "+447937985869",
    "auth_token": "306c22b16ba5caf954c4259969bf5cb9",
    "user_id": "a51c4d26-c6da-428a-91da-5abcf665ea92",
    "logged": true,
    "default_username_status": true,
    "default_username": "sgdhhsjskabfbc"
}

@mgp25
Copy link
Owner

mgp25 commented Jul 22, 2015

@hako thx :)

@mgp25 mgp25 closed this as completed in 212043f Jul 22, 2015
@seesoe
Copy link
Author

seesoe commented Jul 25, 2015

im still getting 400 - BAD_REQUEST

also you forgot to set the variable string on line 499
https://github.com/mgp25/SC-API/blob/master/src/snapchat.php#L499

I added the following but still keep getting 400 bad request.

$req_token = parent::hash(parent::STATIC_TOKEN, $timestamp);
$string = $username . "|" . $password . "|" . $timestamp . "|" . $req_token;

@mgp25
Copy link
Owner

mgp25 commented Jul 25, 2015

👍 Thanks you :)

Fixed: 1020c44

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants