Skip to content

Instantly share code, notes, and snippets.

@wochap
Last active August 1, 2016 15:49
Show Gist options
  • Save wochap/efbac946136ec88fabf3 to your computer and use it in GitHub Desktop.
Save wochap/efbac946136ec88fabf3 to your computer and use it in GitHub Desktop.
API Rica Rica

Agencia

1. Obtener todas las categories

[GET] api/agency

Example

GET

Link: api/agency

Response

{
  "agency": {
    "description": "html_string",
    "gallery": {
      "photos": [
        ...muchasPhotos, {
          "id": 2,
          "src":"http://www.euroresidentes.com/hogar/mascotas/wp-content/uploads/sites/5/2016/01/cachorro.png"
        }
      ],
      "videos": [
        ...muchosVideos, {
          "id": 5,
          "src": "https://www.youtube.com/watch?v=goKeotF-7nA"
        }
      ]
    }
  }
}

Categories

1. Obtener todas las categories

[GET] api/categories

Example

GET

Link: api/categories

Response

{
  "categories": [
    ...muchasCategories, {
      "id": 1,
      "name": "Trekking",
      "slug": "trekking",
      "feature_image_url": "https://googledrive.com/host/0BwM5_eez3JnoeFlHblRYRS1UX2c/6.jpg"
    }
  ]
}

1. Obtener una category

[GET] api/categories/:id

Example

GET

Link: api/categories/1

Response

Status: 200 OK
{}

Countries

1. Obtener countries

[GET] api/countries

Example

GET

Link: api/countries

Response

{
  "countries": [
    ...manyCountries, {
      "id": 1,
      "name": "Chile"
    }
  ]
}

Destinations

1. Obtener todos los destinos

[GET] api/destinations

Example

GET

Link: api/destinations

Response

{
  "destinations": [
    ...muchosDestinos, {
      "id": 1,
      "title": "Titulo del destino",
      "slug": "titulo-del-destino",
      "feature_image_url": "image450x350"
    }
  ]
}

2. Obtener todos los destinos destacados

[GET] api/destinations?destacados=true

Example

GET

Link: api/destinations?destacados=true

Response

{
  "destinations": [
    ...muchosDestinos, {
      "id": 1,
      "title": "Titulo del destino",
      "slug": "titulo-del-destino",
      "feature_image_url": "image450x350"
    }
  ]
}

3. Obtener un destino

[GET] api/destinations/:id

Example

GET

Link: api/destinations/1

Response

{
  "destination": {
    "id": 1,
    "title": "Titulo del destino",
    "slug": "titulo-del-destino",
    "description": "html_string",
    "photos": [
      muchasPhotos, {
        "id": 1,
        "src": "https://googledrive.com/host/0BwM5_eez3JnoeFlHblRYRS1UX2c/7.jpg"
      }
    ],
    "tours": [
      muchosTours, {
        "id": 1
      }
    ]
  }
}

Langs

1. Obtener todos los lenguajes

[GET] api/langs

Example

GET

Link: api/langs

Response

{
  "langs": [
    ...muchosLangs, {
      "id": 1,
      "imageUrl": "https://static.platzi.com/static/images/languajes/chile.jpg",
      "label": "es"
    }
  ]
}

2. Obtener lenguaje

[GET] api/locales/:id

Example

GET

Link: api/locales/1

Response

{
  "nav": {
    ...
  },
  ...
}

Ricarica

1. Obtener datos de RicaRica

[GET] api/ricarica

Example

GET

Link: api/ricarica

Response

{
  "ricarica": {
    "whatsapp": "+56 988 965 672",
    "logo": "/static/images/logo.png",
    "logoWhite": "/static/images/logo-white.png",
    "eslogan": "Vive tu experiencia",
    "socialLinks": {
      "facebook": "#!",
      "twitter": "#!-"
    }
  }
}

Tours

1. Obtener todos los tours

[GET] api/tours

Example

GET

Link: api/tours

Response

{
  "tours": [
    ...muchosTours, {
      "id": 1,
      "title": "Valle de la luna",
      "slug": "valle-de-la-luna",
      "feature_image_url": "https://googledrive.com/host/0BwM5_eez3JnoeFlHblRYRS1UX2c/7.jpg",
      "category": {
        "id": 1,
        "name": "Trekking",
        "slug": "trekking"
      },
      "price": 250000,
      "discount": {
        "flag": true,
        "price": 200000
      },
      "details": {
        "destination": "Luna",
        "duration": "3 horas",
        "distance_height": "500 Km",
        "itineraries": [
          ...muchasActivities, {
            "activity": "Despetarse y subir al bus"
          }
        ]
      }
    }
  ]
}

1. Obtener todos los tours destacados

[GET] api/tours?destacados=true

Example

GET

Link: api/tours?destacados=true

Response

{
  "tours": [
    ...muchosTours, {
      "id": 1,
      "title": "Valle de la luna",
      "slug": "valle-de-la-luna",
      "feature_image_url": "https://googledrive.com/host/0BwM5_eez3JnoeFlHblRYRS1UX2c/7.jpg",
      "category": {
        "id": 1,
        "slug": "trekking"
      },
      "price": 250000,
      "discount": {
        "flag": true,
        "price": 200000
      }
    }
  ]
}

3. Obtener un tour

[GET] api/tours/:id

Example

GET

Link: api/tours/1

Response

{
  "tour": {
    "id": 1,
    "title": "Valle de la luna",
    "slug": "valle-de-la-luna",
    "feature_image_url": "https://googledrive.com/host/0BwM5_eez3JnoeFlHblRYRS1UX2c/7.jpg",
    "category": {
      "id": 1,
      "name": "Trekking",
      "slug": "trekking"
    },
    "price": 250000,
    "discount": {
      "flag": true,
      "price": 200000
    },
    "details": {
      "destination": "San Pedro de Atacama",
      "duration": "5 horas",
      "distance_height": "300 Km",
      "itineraries": [
        ...muchasActivities, {
          "activity": "Despetarse y subir al bus"
        }
      ]
    },
    "recommendations": "Se recomienda el uso de bloqueador",
    "additional_service": "Servicio de comida light y no light",
    "experiences": {
      "photos": [
        ...muchasPhotos, {
          "id": 2,
          "src":"http://www.euroresidentes.com/hogar/mascotas/wp-content/uploads/sites/5/2016/01/cachorro.png"
        }
      ],
      "videos": [
        ...muchosVideos, {
          "id": 5,
          "src": "https://www.youtube.com/watch?v=goKeotF-7nA"
        }
      ]
    }
  }
}

4. Enviar Tours (realizar pedido)

[POST] api/tours

Example

POST

Link: api/tours

Data

{
  "paymentType": 1,
  "tours": [
    ...muchosTours, {
      "id": 1,
      "passengers": {
        "children": 5,
        "adults": 2
      },
      "date": "fechaISO"
    }
  ],
  "user": {
    "dniRuc": "123123213",
    "docType": 1,
    "firstname": "Gean Carlos",
    "lastname": "Bonifacio Marroquin",
    "email": "miemail@genial.com",
    "phoneNumber": "258925",
    "cellPhoneNumber": "987456258",
    "comment": "cadena de texto"
  },
  "creditCard": {
    "number": "4929685682067788",
    "cvv": "123",
    "expiration": {
      "year": "2016",
      "month": "12"
    }
  }
}

Response

{
  "success": true,
  "amount": 120 
}

Actualizar repositorio principal

  1. Pull ricaricafrontend
  2. Delete public/static folder in ricarica
  3. Copy laravel/public/static folder in ricaricafrontend to public in ricarica
  4. Copy laravel/app/views/landing folder in ricaricafrontend to app/views in ricarica
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment