Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding contacts #48

Open
SerRashin opened this issue Oct 24, 2016 · 1 comment
Open

adding contacts #48

SerRashin opened this issue Oct 24, 2016 · 1 comment

Comments

@SerRashin
Copy link

hi diar friend, I write code for adding new contact

RequestService.prototype.add = function (skypeAccount, userName) {
        var reqURI = Consts.SKYPEWEB_HTTPS + Consts.SKYPEWEB_CONTACTS_HOST + '/contacts/v2/users/' + skypeAccount._selfInfo.username + '/contacts';


        this.requestWithJar.post(reqURI, {
            headers: {
                'Accept': 'application/json; ver=1.0',
                'Accept-Encoding': 'gzip, deflate, br',
                'Accept-Language': 'en-US,en;q=0.5',
                'Content-Type': 'application/json',
                'Host': 'contacts.skype.com',
                'Origin': 'https://web.skype.com',
                'Referer': 'https://web.skype.com/en/',
                'X-Skype-Caller': 'skype.com',
                'X-Skypetoken': skypeAccount.skypeToken
            },
            json: {
                greeting: "hi "+ userName + " add me please :)",
                mri: "8:"+userName
            }
        }, function (error, response, body) {
            if (!error && response.statusCode === 201) {
                return JSON.parse(body);
            } else {
                utils_1.default.throwError('Failed to accept friend.' + error + "/" + JSON.stringify(response));
            }
        });
    };
@ShyykoSerhiy
Copy link
Owner

Cheers @serhanters. I'll add it on this weekend. Thx.
If you want you can open pull request 👍

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

No branches or pull requests

2 participants