favattic.com

Techical Documentation: favattic Web Service Layer

This document describes the favattic Web Services layer, which can be used for accessing and manipulating bookmarks, and related data, within favattic.

1 Creating Bookmarks

This paragraph gives guidelines on how to develop a GUI client for the creation of bookmarks using the Web Services layer provided by favattic - Online Bookmark Manager. It contains documentation for all web services related to creating bookmarks.

1.2 Basics

1.3 Login

Request URI:

https://test.favattic.com/internethome/services/rs/authentication/login

Request type:

POST

Input Parameters:

{"email": "test@gmx.de", "password": "testpwd124", "isStayLoggedIn": true, "clientCode": 3}

Notes: if setting "isStayLoggedIn" to true, a Stay-Logged-In-Feature will be used for the login, which means that the user will not have to provide an email and password for subsequent logins. In the case the login operation returns a loginCookie. This loginCookie can be used for subsequent logins. See also Web Service operation 'Login with Login Cookie'. clientCode describes the type of client that is calling the login operation.

Output Data

{
    "loginCookie":"oliver.misch.om@gmail.com#####e163ee64-12ee-4f40-9291-d17921984484#####0bdcda86-26e1-45a2-8462-d8833fe3e16b",
    "token":"0bdcda86-26e1-45a2-8462-d8833fe3e16b"
}

Example Call

var request = new XMLHttpRequest();
request.open('POST', 'https://test.favattic.com/internethome/services/rs/authentication/login', true);
request.setRequestHeader('Content-type', 'application/json');
request.send('{"email": "test@gmx.de", "password": "testpwd124", "isStayLoggedIn": true, "clientCode": 3}');

1.4 Login with Login Cookie

Request URI:

https://test.favattic.com/internethome/services/rs/authentication/login

Request type:

POST

Input Parameters:

{"email": null, "password": null, "isStayLoggedIn": true, "loginCookie": "fbqbqwdb23611", "clientCode": 3}

Note: the "loginCookie" was provided by a former call of the login operation.

Output Data

{
    "loginCookie":"oliver.misch.om@gmail.com#####e163ee64-12ee-4f40-9291-d17921984484#####0bdcda86-26e1-45a2-8462-d8833fe3e16b",
    "token":"0bdcda86-26e1-45a2-8462-d8833fe3e16b"
}

Example Call

var request = new XMLHttpRequest();
request.open('POST', 'https://test.favattic.com/internethome/services/rs/authentication/login', true);
request.setRequestHeader('Content-type', 'application/json');
request.send('{"email": null, "password": null, "isStayLoggedIn": true, "loginCookie": "fbqbqwdb23611", "clientCode": 3}');

1.5 End Session

Request URI:

https://test.favattic.com/internethome/services/rs/authentication/end-session

Request type:

POST

Input Parameters:

{"token": "abd8822557878ads"}

Note: the token is provided by the login operation

Output Data

true, or false (depending on the success of the operation)

Example Call

var request = new XMLHttpRequest();
request.open('POST', 'https://test.favattic.com/internethome/services/rs/authentication/end-session', true);
request.setRequestHeader('Content-type', 'application/json');
request.send('{"token": "abd8822557878ads"}');

1.6 Logout

Request URI:

https://test.favattic.com/internethome/services/rs/authentication/logout

Request type:

POST

Input Parameters:

{"token": "abd8822557878ads"}

Note: the token is provided by the login operation

Output Data

true, or false (depending on the success of the operation)

Example Call

var request = new XMLHttpRequest();
request.open('POST', 'https://test.favattic.com/internethome/services/rs/authentication/logout', true);
request.setRequestHeader('Content-type', 'application/json');
request.send('{"token": "abd8822557878ads"}');

1.7 Load Bookmark Libraries

Request URI:

https://test.favattic.com/internethome/services/rs/favorite/receive-attic-names/

Request type:

POST

Input Parameters:

{"token": "abd8822557878ads"}

Note: the token is provided by the login operation

Output Data

[{"atticId":390,"atticName":"Private"},
 {"atticId":382,"atticName":"Business"},
 {"atticId":383,"atticName":"Sports"},
 {"atticId":746,"atticName":"Read Later"}]

Output data is an array of objects with 'atticId' and 'atticName'

Example Call

var request = new XMLHttpRequest();
request.open('POST', 'https://test.favattic.com/internethome/services/rs/favorite/receive-attic-names/', true);
request.setRequestHeader('Content-type', 'application/json');
request.send('{"token": "abd8822557878ads"}');

1.8 Load Bookmark Folders

Request URI:

https://test.favattic.com/internethome/services/rs/favorite/receive-favorites/

Request type:

GET

Input Parameters:

For this operation, input parameters are given as URL parameters. The URL has to look like this:

https://test.favattic.com/internethome/services/rs/favorite/receive-favorites/abd8822557878ads/1000/-1/true

Please note: The parameter 'abd8822557878ads' in this example URL is the session token, provided by the login operation. The rest of the URL can always be the same like in this example.

Output Data

{"moreAttics":false,
 "totalNumberOfAttics": 2,
 "attics":[{
    "name":"Private",   
    "id":390,
    "description":""
    "rootFavorite":{
        "faviconUrl":null,
        "parentId":-1,
        "isFolder":true,
        "url":"",
        "isIFrameEmbeddable":true,
        "title":"Private",
        "comments":"The root node of Private favorites",
        "isSecured":null,
        "position":null,
        "id":42483,
        "trace":2,
        "children":[{
            "faviconUrl":null,
            "parentId":-1,
            "isFolder":true,
            "url":"",
            "isIFrameEmbeddable":true,
            "title":"Sports",
            "comments":"my Sports bookmarks",
            "isSecured":null,
            "position":1,
            "id":42484,
            "trace":2,
            "children":[]
        },{
            "faviconUrl":null,
            "parentId":-1,
            "isFolder":true,
            "url":"",
            "isIFrameEmbeddable":true,
            "title":"Thailand",
            "comments":"Holiday bookmarks",
            "isSecured":null,
            "position":1,
            "id":42485,
            "trace":2,
            "children":[]
        }]
    }, {
    "name":"Business",  
    "id":391,
    "description":""
    "rootFavorite":{
        "faviconUrl":null,
        "parentId":-1,
        "isFolder":true,
        "url":"",
        "isIFrameEmbeddable":true,
        "title":"Business",
        "comments":"The root node of Business favorites",
        "isSecured":null,
        "position":null,
        "id":42383,
        "trace":2,
        "children":[{
            "faviconUrl":null,
            "parentId":-1,
            "isFolder":true,
            "url":"",
            "isIFrameEmbeddable":true,
            "title":"Work",
            "comments":"my Work bookmarks",
            "isSecured":null,
            "position":1,
            "id":42484,
            "trace":2,
            "children":[]
        },{
            "faviconUrl":null,
            "parentId":-1,
            "isFolder":true,
            "url":"",
            "isIFrameEmbeddable":true,
            "title":"Job Applications",
            "comments":"Job Applications bookmarks",
            "isSecured":null,
            "position":1,
            "id":42485,
            "trace":2,
            "children":[]
        }]
    }],
}

Example Call

var request = new XMLHttpRequest();
request.open('GET', 'https://test.favattic.com/internethome/services/rs/favorite/receive-favorites/abd8822557878ads/1000/-1/true', true);
request.send();

1.9 Create Bookmark

Request URI:

https://test.favattic.com/internethome/services/rs/favorite/create-favorite

Request type:

POST

Input Parameters:

{
    "token": "abd8822557878ads",
    "favorite": {
        "isFolder": false,
        "title": "Facebook",
        "url": "http://www.facebook.com",
        "comments": "social sharing",
        "rating": 0,
        "isSecured": false,
        "keyWords": "",
        "position": -1,
        "atticId": 1234,
        "parentId": 4321
    }
}

Output Data

{ 
    "createdFavorite": {
        "isFolder": false,
        "title": "Facebook",
        "url": "http://www.facebook.com",
        "comments": "social sharing",
        "rating": 0,
        "isSecured": false,
        "keyWords": "",
        "position": -1,
        "atticId": 1234,
        "parentId": 4321
    },

    "duplicatesInfoDto": {
        "duplicateUrl": "http://www.facebook.com",
        "duplicates": [{
            "id": 12543,
            "atticPath": "Private/Social Media/Facebook"
        }]
    }
}

Example Call

var request = new XMLHttpRequest();
request.open('POST', 'https://test.favattic.com/internethome/services/rs/favorite/create-favorite', true);
request.setRequestHeader('Content-type', 'application/json');
request.send('{"token": "abd8822557878ads", favorite": {
        "isFolder": false, 
        "title": "Facebook",
        "url": "http://www.facebook.com",
        "comments": "social sharing",
        "rating": 0,
        "isSecured": false,
        "keyWords": "",
        "position": -1,
        "atticId": 1234,
        "parentId": 4321
    }
}');

1.10 Check Bookmark Duplicates

Request URI:

https://test.favattic.com/internethome/services/rs/favorite/check-favorite-duplicates/

Request type:

POST

Input Parameters:

{"url": "http://www.google.com", "token": "abd8822557878ads"}

Note: the token is provided by the login operation

Output Data

{
    duplicateUrl: "http://www.google.com",
    duplicates: 
        [{"id":390,"atticPath":"Private/search/Google"},
         {"id":382,"atticPath":"Business/engines/GoogleCom"},
         {"id":383,"atticPath":"Sports/google"}],
}

Output data is an object caontaining the URL, which is a duplicate, and an array of objects with 'id' and 'atticPath' properties.

Example Call

var request = new XMLHttpRequest();
request.open('POST', 'https://test.favattic.com/internethome/services/rs/favorite/check-favorite-duplicates', true);
request.setRequestHeader('Content-type', 'application/json');
request.send('{"url": "http://www.google.com", "token": "abd8822557878ads"}');

2 Registering

Request URI:

https://test.favattic.com/internethome/services/rs/user/createUser

Request type:

POST

Input Parameters:

{
    "name": "John Test", 
    "email": "john.test@email.com",
    "password": "53gnjern823gernjr",
    "localeCode": "en"
}

Notes:

Output Data

true, or false (depending on the success of the operation). For certain error situations, exceptions are thrown (see paragraph 'Errors and Error Codes').

Example Call

var request = new XMLHttpRequest();
request.open('POST', 'https://test.favattic.com/internethome/services/rs/user/createUser', true);
request.setRequestHeader('Content-type', 'application/json');
request.send('{"name": "John Test", "email": "john.test@email.com", "password": "53gnjern823gernjr", "localeCode": "en"}');

3 Errors and Error Codes