Desarrolladores

Como desarrollador tú puedes crear aplicaciones e instalarlas en EcuaEspacio, esto te ayuda a tomar ventaja de nuestra grande base de datos. Tu aplicación esta en tu servidor, esto te permite a tener control completo a las especificaciones de tu servidor

Creando una APP

To interact with EcuaEspacio your application can issue calls to our API and request or post information.

Cuando tú agregas una aplicación a nuestro sitio, nosotros te daremos una APP ID.

Solicitando un Símbolo (token)

Cada vez que planea en usar nuestro API, usted primero tiene que solicitar un símbolo (token). Ahora para solicitar un símbolo tú necesitas una llave ( key) única que nosotros enviamos a ti cuando un usuario visita tu APP desde un Iframe en tu sitio web. Nosotros pasamos también esto como $_GET['key'].
Este es un ejemplo como tú puedes solicitar un símbolo (token):
http://www.ecuaespacio.com/token.php?key=$_GET['key']
Si es satisfactorio, tú obtendrás una respuesta JSON similar:
Object
(
    [token] => LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUc4d0RRWUpLb1pJaHZjTkFRRUJCUUFEWGdBd1d3SlVBdHFZdmVWOXFEdDd6NFhXTXYzS3VZM2JyWXpUKzR0VgpBbERrN1dQWjhqRVpoVzBNWjE1Z3lHdGNlNm5ueFRNenp4SXpHM29BRVIzc0JVRCtYdStHb21JeVV4UE1RN1NtCkVPdFg0ZTNwekp6R081cUxBZ01CQUFFPQotLS0tLUVORCBQVUJMSUMgS0VZLS0tLS0K
)

Enviando Solicitud

Ahora que tú tienes un símbolo (token) valido tu puedes solicitar a nuestro servidor. Para cada solicitud tú tienes que pasar el símbolo que hemos creado para ti.
Un ejemplo para llamar a nuestro servidor API, parecerá algo similar:
http://www.ecuaespacio.com/api.php?token=#{TOKEN}&method=#{METHOD_NAME}

Entendiendo una Respuesta de API

Para métodos que puedan retornar más de un artículo, la respuesta contendrá un indicador de los artículos totales disponibles así como cuantas páginas hay. Nosotros retornamos por defecto 10 artículos por lo menos. Para obtener más de 10 artículos tú tendrás que pasar el parámetro "page=2".

A la izquierda tu encontraras una lista de modules que implementan lo métodos API. Haz clic en el módulo y tu veras una lista de métodos que tu aplicación podría utilizar. Para fines de formato y una corta implementación nosotros no inclúyenos la solicitudes completas, solamente las partes más relevantes.

friend
getFriends
GET /api.php?method=friend.getFriends&user_id=#{USER_ID}
Obtiene la lista completa de amigos para un especifico usuario. S tu no pasas el #{USER_ID} nosotros retornaremos la información del usuario que esta actualmente iniciado sesión en su cuenta
Respuesta
Object
(
    [api] => Object
        (
            [total] => 1
            [pages] => 0
            [current_page] => 0
        )

    [output] => Array
        (
            [0] => Object
                (
                    [user_id] => 7
                    [user_name] => jane-doe
                    [full_name] => Jane Doe
                    [joined] => 1314110027
                    [country_iso] => US
                    [gender] => Female
                    [photo_50px] => http://www.ecuaespacio.com/file/pic/user/7_50.jpg
                    [photo_50px_square] => http://www.ecuaespacio.com/file/pic/user/7_50_square.jpg
                    [photo_120px] => http://www.ecuaespacio.com/file/pic/user/7_120.jpg
                    [photo_original] => http://www.ecuaespacio.com/file/pic/user/7.jpg
                    [profile_url] => http://www.ecuaespacio.com/index.php?do=/jane-doe/
                )

        )

)
isFriend
GET /api.php?method=friend.isFriend&user_id=#{USER_ID}&friend_user_id=#{FRIEND_USER_ID}
Esto chequea si 2 usuarios son amigos o no son amigos. Si tu no pasas el #{USER_ID} nosotros retornaremos la información acerca de usuarios que esta actualmente iniciado sesión en su cuenta.
Respuesta
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => Object
        (
            [is_friend] => 1
        )

)
mail
getNewCount
GET /api.php?method=mail.getNewCount&user_id=#{USER_ID}
Get the total number of unseen messages. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Respuesta
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => 1
)
notification
getNewCount
GET /api.php?method=notification.getNewCount&user_id=#{USER_ID}
Get the total number of unseen notifications. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Respuesta
Object
(
    [api] => Object
        (
            [total] => 5
            [pages] => 0
            [current_page] => 0
        )

    [output] => 5
)
get
GET /api.php?method=notification.get&user_id=#{USER_ID}
Get all of the users notifications. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Respuesta
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => Array
        (
            [0] => Object
                (
                    [notification_id] => 3
                    [link] => http://www.ecuaespacio.com/john-doe/comment-id_1/
                    [message] => Jane Doe commented on your wall
                    [icon] => http://www.ecuaespacio.com/module/blog/static/image/default/default/activity.png
                )

        )

)
photo
addPhoto
POST /api.php?method=photo.addPhoto&photo=#{@FILE_PATH;TYPE=MIME_TYPE}&photo_name=#{BASE_FILE_NAME}
Uploads a photo on behalf of the user.
Respuesta
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => Object
        (
            [original] => http://www.ecuaespacio.com/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d.jpg
            [75px] => http://www.ecuaespacio.com/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_75.jpg
            [100px] => http://www.ecuaespacio.com/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_100.jpg
            [150px] => http://www.ecuaespacio.com/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_150.jpg
            [240px] => http://www.ecuaespacio.com/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_240.jpg
            [500px] => http://www.ecuaespacio.com/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_500.jpg
            [1024px] => http://www.ecuaespacio.com/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_1024.jpg
        )

)
getPhotos
GET /api.php?method=photo.getPhotos&user_id=#{USER_ID}
Get all the photos for a user. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Respuesta
Object
(
    [api] => Object
        (
            [total] => 1
            [pages] => 0
            [current_page] => 0
        )

    [output] => Array
        (
            [0] => Object
                (
                    [photo_100px] => http://www.ecuaespacio.com/file/pic/photo/c81e728d9d4c2f636f067f89cc14862c_100.jpg
                    [photo_240px] => http://www.ecuaespacio.com/file/pic/photo/c81e728d9d4c2f636f067f89cc14862c_240.jpg
                    [photo_original] => http://www.ecuaespacio.com/file/pic/photo/c81e728d9d4c2f636f067f89cc14862c.jpg
                )

        )

)
user
getUser
GET /api.php?method=user.getUser&user_id=#{USER_ID}
Get information about a user based on the user ID# you pass. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Respuesta
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => Object
        (
            [user_id] => 1
            [user_name] => john-doe
            [joined] => 1314109907
            [gender] => Male
            [country_iso] => US
            [full_name] => John Doe
            [email] => john.doe@site.com
            [photo_50px] => http://www.ecuaespacio.com/file/pic/user/2011/08/9d673759d1cf55c9cd0b0805dc32e68e_50.jpg
            [photo_50px_square] => http://www.ecuaespacio.com/file/pic/user/2011/08/9d673759d1cf55c9cd0b0805dc32e68e_50_square.jpg
            [photo_120px] => http://www.ecuaespacio.com/file/pic/user/2011/08/9d673759d1cf55c9cd0b0805dc32e68e_120.jpg
            [photo_original] => http://www.ecuaespacio.com/file/pic/user/2011/08/9d673759d1cf55c9cd0b0805dc32e68e.jpg
            [profile_url] => http://www.ecuaespacio.com/index.php?do=/john-doe/
        )

)