Eskup is basically ELPAIS.com's messaging system and we'll use the API to communicate with it. We can distinguish three points of access to the API:
Before we start our approach to the API itself, it is important to understand the concepts from API's view, no matter how we name them from the user's point of view. Now we need understand the API calling parameters.
In addition, as we have just seen, each object may have up to 4 boards or panels:
As you may already know, we want your feedback in ELPAIS.com and, if possible, even more with Eskup. It is very important for us that you post any problem, question, suggestion, etc. you may send it to the *eskup topic. We will do our best to answer you as soon as possible.
It's the handler used to process requests related with messages.
http://eskup.elpais.com/Ineskup
id |
User's public key (as it appears in your "Opciones" (Options) link). It is a mandatory parameter. | |
|---|---|---|
c |
Command to be executed over the message. | Possible values:
Restrictions:
|
m |
Message content. | Indicates the message content, both regarding new and forwarded
messages ( Restrictions:
|
t |
Message destination. | Indicates the destination of the message. Several destinations
can be indicated by separating their name by the character Possible cases:
Restrictions:
|
x |
Extra data. | Possible values:
Restrictions:
|
f |
Reply to the request's format | Possible values:
|
p |
Image associated with the message. | In order to send images the request must be done by POST with Restrictions:
|
d |
External targets | In order to send the message to Twitter ( |
Other errors in connection with the handler:
text |
ok [extra-info] <id-mensaje> |
|---|---|
json |
{'status':'ok','info':'[extra-info]','idmsg':'<id-mensaje>'} |
xml |
<eskup> <status>ok</status> <info><![CDATA[[extra-info]]]></info> <idmsg><id-mensaje></idmsg> </eskup> |
html |
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>Eskup</title>
</head>
<body>
<h1 id="status">OK</h1>
<p id="info">[extra-info]</p>
<p id="idmsg"><id-mensaje></p>
</body>
</html> |
[extra-info] will contain additional information on the
performed action
<id-mensaje> will contain the new message id generated
When the request returns an error it is redirected to the following url, where the occurred error is specified:
http://eskup.elpais.com/Scripts/errors.html
text |
error <error_code> [error_info] |
|---|---|
json |
{'status':'error','code':'<error_code>','info':'[error_info]'} |
xml |
<eskup> <status>error</status> <code><error_code></code> <info><![CDATA[[error_info]]]></info> </eskup> |
html |
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>Eskup</title>
</head>
<body>
<h1 id="status">ERROR</h1>
<p id="code"><error_code></p>
<p id="info">[error_info]</p>
</body>
</html> |
[error_code] error's internal code
[error_info] additional information on the error
http://eskup.elpais.com/Ineskup?id=<public_ID>&c=add&m=<message> |
|---|
| Send a message to 'mis mensajes' (my messages) |
http://eskup.elpais.com/Ineskup?id=<public_ID>&c=add&m=<message>t=john|mary |
| Send a private message to 'john' and 'mary' |
http://eskup.elpais.com/Ineskup?id=<public_ID>&c=add&m=<message>&t=*hartosdelcoche |
| Send a message to the topic 'Hartos del coche' (Fed up with the car) |
http://eskup.elpais.com/Ineskup?id=<public_ID>&c=add&m=<message>&t=*eskup|*loquepasaporlatele |
| Send a message to the topics 'Eskup' and 'Lo que pasa por la tele' (What goes on tv) |
http://eskup.elpais.com/Ineskup?id=<public_ID>&c=reply&x=<messageID_to_reply>&m=<reply_message> |
| Reply to a message |
http://eskup.elpais.com/Ineskup?id=<public_ID>&c=del&x=<messageID_to_delete> |
| Delete a message |
http://eskup.elpais.com/Ineskup?id=<public_ID>&c=del&x=<messageID_to_delete>&t=p |
| Delete a private message from my board 'en privado' (in private) |
http://eskup.elpais.com/Ineskup?id=<public_ID>&c=edit&x=<messageID_to_edit>&m=<new_message> |
| Edit a message |
http://eskup.elpais.com/Ineskup?id=<public_ID>&c=add&x=<messageID_to_forward>&m=<forwarded_message> |
| Forward a message |
It's the handler used to return messages, grouped as requested.
http://eskup.elpais.com/Outeskup
id |
Public key identifying the user | |
|---|---|---|
t |
Requested board (2 by default) |
The following can be requested only while authenticated
|
f |
Format. (json by default) |
|
p |
Page number (1 by default) | |
msg |
Message identifier if what you want is a thread or an individual message. | |
th |
I want a thread (1) or just the message (0) referenced
by msg. |
|
ts |
Last update's date (in unix timestamp format). If this is sent, it's used to decide if the information in the server is later or not to the indicated date | |
nummsg |
Number of messages per page. (50 by default, 100 maximum) | |
http://eskup.elpais.com/Outeskup?t=t1-<user> |
A user's board |
|---|---|
http://eskup.elpais.com/Outeskup?t=t4-<user> |
The board with references to a certain user |
http://eskup.elpais.com/Outeskup?msg=<messageID> |
A specific message |
http://eskup.elpais.com/Outeskup?msg=<messageID>&th=1 |
Conversation thread to which a certain message belongs |
http://eskup.elpais.com/Outeskup?t=2&id=<public_ID> |
My subscribed boards |
|---|---|
http://eskup.elpais.com/Outeskup?t=3&id=<public_ID> |
My private messages |
numMensajes |
Number of messages in the board | |
|---|---|---|
errorCode |
Error code. If everything is ok, then it is 0 | |
ts |
Timestamp passed by parameter. When not passed, current time. | |
horaActual |
Timestamp of the current time. | |
ultimavisita |
Only if the request comes from an authenticated user | |
updated |
Update's date |
Only if the request comes from an authenticated user:
|
messages |
Messages list | Each message contains:
If includes an image:
When it is part of a conversation:
|
perfilesUsuarios |
Profiles of every user appearing in the messages list |
If the profile is public, it returns next fields, too:
|
perfilesEventos |
Profile of every event appearing in messages in the messages list |
|
Petición:
http://eskup.elpais.com/Outeskup?t=ev-eskup&nummsg=2
Reply:
{
"numMensajes" : 5,
"horaActual" : 1275327910,
"errorCode" : 0,
"ts" : "1275327910.05798292",
"ultimaVisita" : 0,
"updated" : {
"ev-eskup" : 1275316378
},
"perfilesEventos" : {
"eskup" : {
"estado_seguimiento" : 0,
"ts_ultimo_mensaje" : "1275316379.70689702",
"tipo_suscripcion" : 1,
"codigo_html_libre" : 0,
"sub_automatica" : 0,
"activo" : 1,
"estado_escritura" : 0,
"numero_caracteres_mensaje" : 280,
"nombre" : "Eskup",
"numero_seguidores_evento" : 0,
"ts_inicio" : 1275316203,
"ts_final" : 2147483647,
"adm" : [],
"prop" : [
"elpais"
],
"pathfoto" : "",
"refresco_automatico" : 0,
"apoyos" : {
"1" : {
"tipo_apoyo" : "",
"titulo_apoyo" : "",
"enlace_apoyo" : ""
},
"4" : {
"tipo_apoyo" : "",
"titulo_apoyo" : "",
"enlace_apoyo" : ""
},
"3" : {
"tipo_apoyo" : "",
"titulo_apoyo" : "",
"enlace_apoyo" : ""
},
"2" : {
"tipo_apoyo" : "",
"titulo_apoyo" : "",
"enlace_apoyo" : ""
}
},
"clave_publicidad" : "",
"numero_writers_evento" : 2,
"nombreparamovil" : "",
"descripcion" : "Aquí podrás debatir todo aquello relacionado con Eskup como
herramienta, enviar tus dudas sobre el funcionamiento, etc.",
"etiquetas" : [],
"num_mensajes" : 2
}
},
"mensajes" : [
{
"tsMensaje" : 1275316378,
"reenvio" : 0,
"usuarioOrigen" : "oscar",
"borrado" : 0,
"autorMsgRespuesta" : 0,
"level" : 0,
"via" : "web",
"idMsg" : "1275316378-2d88140357ba9cc6e545c01bf14be2d6",
"hilo" : 0,
"cont_adicional" : 0,
"CopiaEnTablones" : "t1-oscar,ev-eskup",
"idMsgRespuesta" : 0,
"contenido" : "Tengo una duda sobre cómo funciona Eskup. ¿Es en este tema
en el que se deben preguntar estas cosas?"
},
{
"tsMensaje" : 1275316331,
"reenvio" : 0,
"usuarioOrigen" : "oscar",
"borrado" : 0,
"autorMsgRespuesta" : 0,
"level" : 0,
"via" : "web",
"idMsg" : "1275316331-aced01f435d25bb91535b13d5f8f234f",
"hilo" : 0,
"cont_adicional" : 0,
"CopiaEnTablones" : "t1-oscar,ev-eskup",
"idMsgRespuesta" : 0,
"contenido" : "Esto de Eskup tiene buena pinta..."
}
],
"perfilesUsuarios" : {
"oscar" : {
"urltwitter" : "http://twitter.com/oscaretu",
"seguido" : 0,
"pathfoto" : "",
"numero_eventos_escribe" : 1,
"bloqueado" : 0,
"activo" : 0,
"apellidos" : "",
"urlblog" : "",
"urlwebpersonal" : "http://www.soitu.es/u/oscar",
"descripcion" : "Mutante",
"nombre" : ""
}
}
}
Petición:
http://eskup.elpais.com/Outeskup?t=ev-eskup&nummsg=2&f=xml
Respuesta:
<xml>
<numMensajes><![CDATA[2]]></numMensajes>
<errorCode><![CDATA[0]]></errorCode>
<ts><![CDATA[1275326221.3943181]]></ts>
<perfilesEventos>
<eskup>
<estado_seguimiento><![CDATA[0]]></estado_seguimiento>
<ts_ultimo_mensaje><![CDATA[1275316379.70689702]]></ts_ultimo_mensaje>
<tipo_suscripcion><![CDATA[1]]></tipo_suscripcion>
<codigo_html_libre><![CDATA[0]]></codigo_html_libre>
<sub_automatica><![CDATA[0]]></sub_automatica>
<activo><![CDATA[1]]></activo>
<estado_escritura><![CDATA[0]]></estado_escritura>
<numero_caracteres_mensaje><![CDATA[280]]></numero_caracteres_mensaje>
<nombre><![CDATA[Eskup]]></nombre>
<numero_seguidores_evento><![CDATA[0]]></numero_seguidores_evento>
<ts_inicio><![CDATA[1275316203]]></ts_inicio>
<ts_final><![CDATA[2147483647]]></ts_final>
<adm></adm>
<prop>
<element><![CDATA[elpais]]></element>
</prop>
<pathfoto><![CDATA[]]></pathfoto>
<refresco_automatico><![CDATA[0]]></refresco_automatico>
<apoyos>
<_4>
<titulo_apoyo><![CDATA[]]></titulo_apoyo>
<tipo_apoyo><![CDATA[]]></tipo_apoyo>
<enlace_apoyo><![CDATA[]]></enlace_apoyo>
</_4>
<_1>
<titulo_apoyo><![CDATA[]]></titulo_apoyo>
<tipo_apoyo><![CDATA[]]></tipo_apoyo>
<enlace_apoyo><![CDATA[]]></enlace_apoyo>
</_1>
<_3>
<titulo_apoyo><![CDATA[]]></titulo_apoyo>
<tipo_apoyo><![CDATA[]]></tipo_apoyo>
<enlace_apoyo><![CDATA[]]></enlace_apoyo>
</_3>
<_2>
<titulo_apoyo><![CDATA[]]></titulo_apoyo>
<tipo_apoyo><![CDATA[]]></tipo_apoyo>
<enlace_apoyo><![CDATA[]]></enlace_apoyo>
</_2>
</apoyos>
<clave_publicidad><![CDATA[]]></clave_publicidad>
<descripcion><![CDATA[Aquí podrás debatir todo aquello relacionado con Eskup como
herramienta, enviar tus dudas sobre el funcionamiento, etc.]]></descripcion>
<nombreparamovil><![CDATA[]]></nombreparamovil>
<numero_writers_evento><![CDATA[2]]></numero_writers_evento>
<num_mensajes><![CDATA[2]]></num_mensajes>
<etiquetas></etiquetas>
</eskup>
</perfilesEventos>
<perfilesUsuarios>
<oscar>
<urltwitter><![CDATA[http://twitter.com/oscaretu]]></urltwitter>
<seguido><![CDATA[0]]></seguido>
<pathfoto><![CDATA[]]></pathfoto>
<numero_eventos_escribe><![CDATA[1]]></numero_eventos_escribe>
<bloqueado><![CDATA[0]]></bloqueado>
<activo><![CDATA[0]]></activo>
<apellidos><![CDATA[]]></apellidos>
<urlblog><![CDATA[]]></urlblog>
<urlwebpersonal><![CDATA[http://www.soitu.es/u/oscar]]></urlwebpersonal>
<descripcion><![CDATA[Mutante]]></descripcion>
<nombre><![CDATA[]]></nombre>
</oscar>
</perfilesUsuarios>
<mensajes>
<element>
<reenvio><![CDATA[0]]></reenvio>
<tsMensaje><![CDATA[1275316378]]></tsMensaje>
<usuarioOrigen><![CDATA[oscar]]></usuarioOrigen>
<borrado><![CDATA[0]]></borrado>
<autorMsgRespuesta><![CDATA[0]]></autorMsgRespuesta>
<via><![CDATA[web]]></via>
<idMsg><![CDATA[1275316378-2d88140357ba9cc6e545c01bf14be2d6]]></idMsg>
<hilo><![CDATA[0]]></hilo>
<level><![CDATA[0]]></level>
<CopiaEnTablones><![CDATA[t1-oscar,ev-eskup]]></CopiaEnTablones>
<cont_adicional><![CDATA[0]]></cont_adicional>
<idMsgRespuesta><![CDATA[0]]></idMsgRespuesta>
<contenido><![CDATA[Tengo una duda sobre cómo funciona Eskup. ¿Es en este tema
en el que se deben preguntar estas cosas?]]></contenido>
</element>
<element>
<reenvio><![CDATA[0]]></reenvio>
<tsMensaje><![CDATA[1275316331]]></tsMensaje>
<usuarioOrigen><![CDATA[oscar]]></usuarioOrigen>
<borrado><![CDATA[0]]></borrado>
<autorMsgRespuesta><![CDATA[0]]></autorMsgRespuesta>
<via><![CDATA[web]]></via>
<idMsg><![CDATA[1275316331-aced01f435d25bb91535b13d5f8f234f]]></idMsg>
<hilo><![CDATA[0]]></hilo>
<level><![CDATA[0]]></level>
<CopiaEnTablones><![CDATA[t1-oscar,ev-eskup]]></CopiaEnTablones>
<cont_adicional><![CDATA[0]]></cont_adicional>
<idMsgRespuesta><![CDATA[0]]></idMsgRespuesta>
<contenido><![CDATA[Esto de Eskup tiene buena pinta...]]></contenido>
</element>
</mensajes>
<updated>
<ev-eskup><![CDATA[1275316378]]></ev-eskup>
</updated>
<ultimavisita><![CDATA[0]]></ultimavisita>
<horaActual>1275326221</horaActual>
</xml>
It's the handler used for managing user's information.
http://eskup.elpais.com/Profileeskup
id |
Public key identifying the user | |
|---|---|---|
action |
Action to perform: | Possible values:
|
f |
Reply's format. | Possible values::
|
data |
Information to be added/deleted. E. g., list of users/events to add, delete, list | |
user |
User on whom to perform the action (the ones allowed) when he/she is not the identified one. | |
event |
Event on which to perform the action. | |
msg |
Message attached for the required cases (when asked to write on an event) | |
pag |
Number of pages when the replies do not fit in a single page | (1 by default). |
maxResp |
Maximum number of replies per page | (30 by default, 100 maximum. 33 in case the case of sorting type 1). |
sort |
There are two sorting types. | By inverse order to the moment of adding that user to the list (type 0) and by activity (type 1. Only first page available) |
http://eskup.elpais.com/Profileeskup?action=info_usuarios&user=<user> |
|---|
| Information about a user |
http://eskup.elpais.com/Profileeskup?action=info_eventos&event=<event> |
| Information on an event |
http://eskup.elpais.com/Profileeskup?action=list_usuarios&user=<user> |
| Whom does a user follow |
http://eskup.elpais.com/Profileeskup?action=list_eventos&user=<user> |
| List of events followed by a user |
http://eskup.elpais.com/Profileeskup?action=list_seguidores&user=<user> |
| A user's followers |
http://eskup.elpais.com/Profileeskup?action=list_seguidores&event=<event> |
| An event' followers |
http://eskup.elpais.com/Profileeskup?action=list_writers&event=<event> |
| Who can write on/in&& an event |
http://eskup.elpais.com/Profileeskup?action=add_eventos&id=<public_ID>&data=<list
of events separated by ,> |
|---|
| To follow an event |
http://eskup.elpais.com/Profileeskup?action=del_eventos&id=<public_ID>&data=<list
of events separated by ,> |
| To stop following an event |
http://eskup.elpais.com/Profileeskup?action=add_usuarios&id=<public_ID>&data=<list
of events separated by ,> |
| To follow a user |
http://eskup.elpais.com/Profileeskup?action=del_usuarios&id=<public_ID>&data=<list
of events separated by ,> |
| To stop following a user |
http://eskup.elpais.com/Profileeskup?action=add_denegaciones&id=<public_ID>&data=<list
of events separated by ,> |
| To block a user to prevent him from sending us private messages |
http://eskup.elpais.com/Profileeskup?action=del_denegaciones&id=<public_ID>&data=<list
of events separated by ,> |
| To unblock a user |
http://eskup.elpais.com/Profileeskup?action=list_denegaciones&id=<public_ID> |
| Blocked users list |
http://eskup.elpais.com/Profileeskup?action=add_writers&id=<public_ID>&data=<list
of events separated by
,>&msg=<mensaje_de_peticion_si_es_un_evento_cerrado> |
| Request having the possibility of writing in/on one or several events |
http://eskup.elpais.com/Profileeskup?action=del_writers&id=<public_ID>&data=<list
of events separated by ,> |
| Stop writing on/in an event |
http://eskup.elpais.com/Profileeskup?action=list_writers&id=<public_ID> |
| List of all the events where a user can write on |
pagina |
Page number | |
|---|---|---|
numeroUsuarios |
Number of users (if users or followers were requested) | |
numeroEventos |
Number of events (if events were requested) | |
perfilesUsuarios |
Profiles of every user if users or followers were requested | Each profile is defined by the user's name and it contains:
If the one who requests is authenticated:
If the profile is public:
If what he/she requested was info and not a list:
|
perfilesEventos |
Profile of every event if they were requested | Each profile is defined by the event's name and contains:
If who is making the request is authenticated
|
Request:
http://eskup.elpais.com/Profileeskup?action=info_eventos&event=eskup
Reply:
{
"ts_actual" : 1275385671,
"perfilesEventos" : {
"eskup" : {
"estado_seguimiento" : 0,
"ts_ultimo_mensaje" : "1275330816.43742609",
"tipo_suscripcion" : 1,
"codigo_html_libre" : 0,
"sub_automatica" : 0,
"activo" : 1,
"estado_escritura" : 0,
"numero_caracteres_mensaje" : 280,
"nombre" : "Eskup",
"numero_seguidores_evento" : 0,
"ts_inicio" : 1275316203,
"ts_final" : 2147483647,
"adm" : [],
"prop" : [
"elpais"
],
"pathfoto" : "",
"refresco_automatico" : 0,
"apoyos" : {
"1" : {
"tipo_apoyo" : "",
"titulo_apoyo" : "",
"enlace_apoyo" : ""
},
"4" : {
"tipo_apoyo" : "",
"titulo_apoyo" : "",
"enlace_apoyo" : ""
},
"3" : {
"tipo_apoyo" : "",
"titulo_apoyo" : "",
"enlace_apoyo" : ""
},
"2" : {
"tipo_apoyo" : "",
"titulo_apoyo" : "",
"enlace_apoyo" : ""
}
},
"clave_publicidad" : "",
"numero_writers_evento" : 2,
"nombreparamovil" : "",
"descripcion" : "Aquí podrás debatir todo aquello relacionado con Eskup como
herramienta, enviar tus dudas sobre el funcionamiento, etc.",
"etiquetas" : [],
"num_mensajes" : 5
}
}
}
Request:
http://eskup.elpais.com/Profileeskup?action=info_eventos&event=eskup&f=xml
Reply:
<xml>
<ts_actual><![CDATA[1275385696]]></ts_actual>
<perfilesEventos>
<eskup>
<estado_seguimiento><![CDATA[0]]></estado_seguimiento>
<ts_ultimo_mensaje><![CDATA[1275330816.43742609]]></ts_ultimo_mensaje>
<tipo_suscripcion><![CDATA[1]]></tipo_suscripcion>
<codigo_html_libre><![CDATA[0]]></codigo_html_libre>
<sub_automatica><![CDATA[0]]></sub_automatica>
<activo><![CDATA[1]]></activo>
<estado_escritura><![CDATA[0]]></estado_escritura>
<numero_caracteres_mensaje><![CDATA[280]]></numero_caracteres_mensaje>
<nombre><![CDATA[Eskup]]></nombre>
<numero_seguidores_evento><![CDATA[0]]></numero_seguidores_evento>
<ts_inicio><![CDATA[1275316203]]></ts_inicio>
<ts_final><![CDATA[2147483647]]></ts_final>
<adm></adm>
<prop>
<element><![CDATA[elpais]]></element>
</prop>
<pathfoto><![CDATA[]]></pathfoto><refresco_automatico><![CDATA[0]]></refresco_automatico>
<apoyos>
<_4>
<titulo_apoyo><![CDATA[]]></titulo_apoyo>
<tipo_apoyo><![CDATA[]]></tipo_apoyo>
<enlace_apoyo><![CDATA[]]></enlace_apoyo>
</_4>
<_1>
<titulo_apoyo><![CDATA[]]></titulo_apoyo>
<tipo_apoyo><![CDATA[]]></tipo_apoyo>
<enlace_apoyo><![CDATA[]]></enlace_apoyo>
</_1>
<_3>
<titulo_apoyo><![CDATA[]]></titulo_apoyo>
<tipo_apoyo><![CDATA[]]></tipo_apoyo>
<enlace_apoyo><![CDATA[]]></enlace_apoyo>
</_3>
<_2>
<titulo_apoyo><![CDATA[]]></titulo_apoyo>
<tipo_apoyo><![CDATA[]]></tipo_apoyo>
<enlace_apoyo><![CDATA[]]></enlace_apoyo>
</_2>
</apoyos>
<clave_publicidad><![CDATA[]]></clave_publicidad>
<descripcion><![CDATA[Aquí podrás debatir todo aquello relacionado con Eskup como
herramienta, enviar tus dudas sobre el funcionamiento, etc.]]></descripcion>
<nombreparamovil><![CDATA[]]></nombreparamovil>
<numero_writers_evento><![CDATA[2]]></numero_writers_evento><num_mensajes><![CDATA[5]]>
</num_mensajes><etiquetas></etiquetas>
</eskup>
</perfilesEventos>
</xml>