Amadeus Hotel API Images - image

Is there any way for me to get Hotel's room images from your self-service API? Does the enterprise API support this functionality?
Based on your own documentation this type of information should be available through the following tag:
"media": [{
"uri": "string"
}]
but I'm not getting this tag using any of the search criteria that I'm currently testing with.

EDIT
This question was related to the Hotel Search API v1 in the new version available (v2) the view=FULL is set by default.
You need to add:
view=FULL
In your query to get the media.
For example:
https://test.api.amadeus.com/v1/shopping/hotel-offers?cityCode=LON&view=FULL
Note: we only have a few images in the test environment, most of the responses contain a fake image.

Related

Can't Get Product Metafields using StoreFront GraphQL API

I am using storefront API for my Shopify store.
And need to retrieve product metafields for my product.
I already added metafields using 3rd party app(Metafields Guru).
I need to get all those metafields for product, and had been following this article.
https://shopify.dev/tutorials/retrieve-metafields-with-storefront-api
{
productByHandle(handle: "xxx-handle") {
id
title
handle
productType
metafields(first: 5) {
edges {
node {
key
value
}
}
}
}
}
But I get an empty array for metafields.
Not sure what I am missing here.
Any help would be appreciated
There are a couple of problems here.
when you created your metafields, you had to assign them to a namespace. When you try to retrieve them with Storefront API, you have to provide this namespace, and you failed to do that.
evem if you created metafields in the admin using some App, you will not see them using Storefront API unless you turn them ON using a special flag.
So that is likely a missed step too. Read up on this and pay attention to the MetafieldStorefrontVisibility. You set the namespace and key to be visible. Meaning you likely will not be creating metafields willy nilly without careful consideration about turning each one on or off to Storefront API access.
I would extend a bit David`s answer as I cannot add comments to other answers yet.
Indeed, you have to make the metafields explicitly visible to Storefront API by running mutation MetafieldStorefrontVisibility. Here are some useful links:
How to retrieve metafield from Shopify
How to use MetafieldStorefrontVisibility
Also, I found a nice app Accentuate Custom Fields that provides UI options for making metafields visible to the Storefront API while configuring the metafields:

New type for the deprecated grocery_or_supermarket type in google-places-API

Looks like google has deprecated a bunch of place types from their places API:
https://developers.google.com/places/web-service/supported_types
"The following types are deprecated, and will continue to be supported until February 16, 2017: establishment, finance, food, general_contractor, grocery_or_supermarket, health, place_of_worship."
I wasn't able to figure out what the new replacement types would be. "food" and "store" are too generic for a grocery related store.
Additionally, the documentation states that these types are deprecated only for the query API. The place-details results "may" still contain them.
A workaround I can implement is to fetch the places using a more generic type (e.g., store), and then filter on my end.. not ideal, but out of ideas. However, this also means that I'll rely on the more granular type (e.g., grocery_or_supermarket) to be mentioned in the response.
Can someone pls comment or share ideas on this issue? (did any of you have to deal with this? would be great if you can share your thoughts)
Thanks
Use Foursquare API for this data instead of Google, just get a Foursquare API key, check the API how to use details online and that should provide the data your need.

Alchemy News API - How to retrieve full text of a article?

The field "enriched.url.text" returns only snippet of a article.But the documentation says it has full text and it is searchable i'm not able to understand it clearly.
Any help would be greatly appreciated
The AlchemyData News API is deprecated (https://www.ibm.com/watson/developercloud/alchemy-data-news.html) and in its place is Watson Discovery News (https://www.ibm.com/watson/developercloud/discovery.html).
To migrate to Watson Discovery, IBM has a document here: https://www.ibm.com/watson/developercloud/doc/discovery/migrate-adn.html
According to the documentation: "the query structure and the structure of data returned is different between Watson Discovery News and AlchemyData News. It is recommended that you query for a single result in Watson Discovery News to view how the data is structured."
If you're still working on this question, the best approach would be to migrate to the Discovery API and then run some test queries to verify you get back the full text for "enriched.url.text" intended.

In strapi what are api templates for?

I've started playing with strapi to see what it can do.
When generating an api through strapi studio, it generates a set of base files to handle the model and api calls.
In the entity folder (e.g. article), there's a templates/default folder created with a default template. For an article entity, I get a ArticleDefault.template.json file with this:
{
"default": {
"attributes": {
"title": {},
"content": {}
},
"displayedAttribute": "title"
}
}
In strapi studio I also then add additional templates for each entity, given it multiple templates.
The command line api generator does not create the templates folder.
I couldn't find anything about it in the documentation I read.
What are the generated templates for?
When would I use them, and how would I choose a particular template if I have multiple?
I'm one of the authors of Strapi.
A template is like a schema of data. Let’s take a simple example. You have an API called Post, sometimes your post have a title and a content attribute, but other times, your post have a title, a subtitle, a cover and a content attribute. In both cases, we’re talking about the same API Post but your schema of data is different. That’s why we implemented the templates! Your needs could be different for the same content.
Then, as you said the CLI doesn't generate a template folder in project. The Studio doesn't use the same generator as the CLI but the behavior of your API is the same.

Example for the RAML file in Anypoint studio

I currently follow this tutorial: https://docs.mulesoft.com/anypoint-platform-for-apis/creating-an-apikit-project-with-maven but I have a problem in creating the RAML file I don't know how to do this and I have to take the information from these two APIs:
• http://www.programmableweb.com/api/wikipedia
• http://www.programmableweb.com/api/weather-channel
#%RAML 0.8
title: Title
version: 1.0
baseUri: http://server/api/
schemas:
- Countries: |
{
"$schema": "which link",
"type" : "",
"properties" : {
}
}
Is Schemas what need to use?
The final goal is to create an API giving some information about cities and countries. In order to do that, I need to communicate with some others API providers (the two links above) toobtain information and craft the JSON response to return the required information..
The RAML is the contract of the RESTful API you want to expose. So, first you need to understand how to code a RAML:
http://raml.org/
Then you can use the component APIKit in Anypoint Studio that generates the flows based on your RAML.
https://docs.mulesoft.com/anypoint-platform-for-apis/apikit-tutorial
After that you will want to connect to third party APIs like wikipedia or weather channel. For that you can use the HTTP Request Connector if those APIs are REST.
https://docs.mulesoft.com/mule-user-guide/v/3.7/http-request-connector
If those APIs are SOAP based you have to use the Webservice Consumer component, that automatically infers the content of the wsdl and you can choose wich method to invoke, and set the necessary parameters.
https://docs.mulesoft.com/mule-user-guide/v/3.7/web-service-consumer
To do the transformations from your received data to the third party APIs data, you should use Dataweave
https://docs.mulesoft.com/mule-user-guide/v/3.7/dataweave
I also recommend the walkthrough tutorials, for designing, building and deploying a new API.
https://docs.mulesoft.com/anypoint-platform-for-apis/anypoint-platform-for-apis-walkthrough

Resources