Hi again! On Fri, Oct 30, 2015 at 10:05 AM, Alberto Martín Casado < alberto.martin at bitergia.com> wrote: > Hi Pablo, > > On Thu, Oct 29, 2015 at 5:55 PM, Pablo Fernández Moniz < > pablofernandezmoniz at gmail.com> wrote: > >> Hi! >> >> We are implementing the create reviews and create reservations >> functionalities from the front end, and some doubts related to the >> associated user have arisen. >> >> We follow the API specification for the devguide ( >> http://docs.devguide.apiary.io/#reference/api-especification-for-devguide/review ) >> and the request bodies of the examples do not contain information about the >> users. [See *no_undername_in_example.png*] >> >> We consulted the reservationsgenerations.js file and we deduce that the >> request body should be like: [See *create_reservation.png*] >> >> >> *{* >> >> * "@type": "FoodEstablishmentReservation",* >> >> * "partySize": 2,* >> >> * "reservationFor": {* >> >> * "@type": "FoodEstablishment",* >> >> * "name": "Elizalde"* >> >> * },* >> >> * "startTime": "2016-12-24T10:10:23.396Z",* >> >> * "underName":{* >> >> * "@type":"Person",* >> >> * "name":"user10"* >> >> * }* >> >> *}* >> >> >> At this point we can create the reservation but without an associated >> user. If we retrieve the reservations we get: [See >> *reservation_without_undername.png*] >> >> *{"@context":"http://schema.org >> <http://schema.org/>","@type":"FoodEstablishmentReservation","partySize":2,"reservationFor":{"@type":"FoodEstablishment","name":"Elizalde","address":{"streetAddress":"Cuesta >> de las Cabras Aldapa >> 2","addressRegion":"Araba","addressLocality":"Alegría-Dulantzi","postalCode":"01240","@type":"postalAddress"}},"reservationStatus":"Pending","startTime":"2016-12-24T10:10:23.396Z","underName":{"@type":"Person"},"reservationId":"Elizalde-418lRljWe"}* >> > >> We have experimented the same issues creating reviews. What are we doing >> wrong? >> > > You are doing it well, don't worry. This logic is about to be implemented > (hopefully by today). As you need to be logged in when creating reviews or > reservations, the idea is to take the user and organization from the IdM > using the access_token user information, as provided in the /client/user > URL. This will be implemented in the server (I mean, by us), so everytime > you create a review or reservation, the user will be added automatically. > > I will let you know as soon as it ready. > > Sorry for the inconvenience! > The logic to add the users automatically is now implemented in reservations and reviews. Regarding organizations, I'm still on it, cause the organizations appears in the interface (horizon) but is not being retrieved in the user information. Best! Alberto Martín -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20151102/7026ce0e/attachment.html>
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy