-
Notifications
You must be signed in to change notification settings - Fork 2
vjrj edited this page Oct 21, 2015
·
5 revisions
Obtener una persona (usuario) por su id:
curl -X GET http://localhost:3000/api/find/person/tMBL9Mg8doBixsT7P
Respuesta:
{
"_id": "tMBL9Mg8doBixsT7P",
"username": "vjrj",
"profile": {
"redesSociales": [
{
"url": "http://twitter.com/vjrj/"
}
]
}
}
Obtener una persona por su username:
curl -X GET http://localhost:3000/api/find/person/u/vjrj
resultado:
{
"_id": "tMBL9Mg8doBixsT7P",
"username": "vjrj",
"profile": {
"redesSociales": [
{
"url": "http://twitter.com/vjrj/"
}
]
}
Obtener todas las personas/usuarios:
curl -X GET http://localhost:3000/api/find/persons
Resultado:
[
{
"_id": "eGehS966BPe7tZduY",
"username": "admin"
},
{
"_id": "tMBL9Mg8doBixsT7P",
"username": "vjrj",
"profile": {
"redesSociales": [
{
"url": "http://twitter.com/vjrj/"
}
]
}
},
{
"_id": "cnAhdf94h4N8MaJGQ",
"username": "vjrj2",
"profile": {}
},
(...)
Consulta de todos los bebes y por id:
curl -X GET http://localhost:3000/api/find/bebes
curl -X GET http://localhost:3000/api/find/bebe/wSqJwTnKgs3aTq8WS
El campo familiar
en bebes
enlaza con las personas.
Otros (provincias, etc):
curl -X GET http://localhost:3000/api/find/provincias
curl -X GET http://localhost:3000/api/find/provincia/50
curl -X GET http://localhost:3000/api/find/municipios
curl -X GET http://localhost:3000/api/find/municipio/id/7
curl -X GET http://localhost:3000/api/find/municipio/prov/4