How to work with the infocenter update¶
Concepts¶
The idea of the infocenter-update endpoints is to push data into the Infocenter. In general we implement connectors to retrieve data from other systems and do the mapping as discover.swiss. With the infocenter-update you can do this process yourself but you need to handle the mapping and logic if an object was deleted and so on yourself.
Access¶
A separate subscription for the API Product "Infocenter Update Test" or "Infocenter Update Prod" is needed. The subscription for the Infocenter API can't be used for the Infocenter Update. You need to be logged-in in the developer portal to see the different API Products.
API¶
Endpoints¶
We offer endpoints for making changes in entities available over the Infocenter. In general for all available types the following endpoints are available:
- [GET] - Retrieve the current version of your pushed data e.g. /creativeWorks/{project}/{sourceId}
- [POST,PUT] - Create or update your data e.g. /creativeWorks/{project}
- [DELETE] - Delete an object you added e.g. /creativeWorks/{project}/{sourceId}
Available types¶
Info
The infocenter-update doesn't support all data types. As soon there is a need for a specific type we can extend the infocenter-update endpoints to make the missing types available too.
Currently the following types can be created:
- CreativeWork with properties of creativeWorks available for update in the infocenter.
- Tour with properties of tours available for update in the infocenter.
- Product with properties of product available for update in the infocenter.
- ImageObject with properties of imageObject available for update in the infocenter.
- FoodEstablishment with properties of foodEstablishment available for update in the infocenter.
- LodgingBusiness with properties of lodgingBusiness available for update in the infocenter.
- Accommodation with properties of lodgingBusiness available for update in the infocenter.
Tip
It is always necessary to send the full object with all properties (no PATCH). To add values in a different language you need to add the translated values for all other languages as well. Languages you do not send we do translate automatically.
Further notes:
- As
sourceId
you should pass a unique ID from your System to identify the object uniquely. - With the flag
autoTranslate
you can control if the data should be automatically translated. Set totrue
if you would like to enable the translation. - If you would like to extend an official HotellerieSuisse object set the HotellerieSuisse ID in
ExternalIds.HotellerieSuisse
property of the LodgingBusiness request. - If you would like to extend an official GastroSuisse object set the GastroSuisse ID in
ExternalIds.GastroSuisse
property of the FoodEstablishment request.
Localization¶
Since you push the data in a multilingual model you get the modification in this format too. In the infocenter API itself the content is then localized by the Localization Header.
Next steps¶
- For more information see Infocenter update service endpoints
- Technical definitions of each API endpoint, sample code, test UI and Open API definitions to download could be found in the developer portal.
-> developer.discover.swiss/apis