Put topics about this connector package here.
Always check the ‘How to use the Alumio connector packages’ topic.
Extra information
System documentation: API — Sylius documentation
Connector package documentation
Table of Contents
-
1. Setting up HTTP Client Sylius
- 1.1 Steps
-
2. Subscribing to entities from Sylius
- 2.1 Steps
- 2.2 General concept
-
3. Publishing entity to Sylius
- 3.1 Steps
- 3.2 General concept
1. Setting up HTTP Client Sylius
1.1 Steps
- In Alumio Dashboard, go to Clients > HTTPS Client. Create a new HTTP Client and select Sylius HTTP Client as the prototype of the HTTP Client.
- Fill in the Base URI
- Choose the “Authentication Type”, you can use “Request Authentication” (JWT Authentication) or “Bearer Token” for this part.
For more information regarding authentication please refer to this Authorization — Sylius documentation page. - In Alumio Dashboard, go to Clients > HTTPS Client. Create a new HTTP Client and select Sylius HTTP Client.
- If you choose “Request Authentication” then you’ll need to fill Username and Password. For “Bearer Token” you’ll need fill the Token.
- You can optionally enable logging of request to get the log of the authentication.
- Save the HTTP Client.
2. Subscribing to Entities from Sylius
2.1 Steps
- Go to Connections → Incoming and create a new incoming configuration and select Sylius Subscriber as the subscriber.
- Select the entity you want to subscribe from Sylius.
- Add public key and secret key.
- Add any request parameters needed to subscribe to the entity (optional).
- You can optionally add a transformer to transform the request parameters into something you need.
- Select the Sylius HTTP Client to use.
- You can add a pagination feature to allow Alumio to fetch a paginated entity.
2.2 General Concept
We follow Sylius documentation on building this connector, so you can easily use the connector based on Sylius API Reference.
Entity
It’s the entity you want to subscribe from Sylius. Please refer to the entities in Management APIs from Sylius API Reference page.
Request Parameters
These are the parameters you can provide to get the needed entity based on Sylius API Reference. Please look at the example below on how to fill Request Parameters when subscribing “Retrieves All Administrator”
Another example is when we want to retrieve a single customer, we can use the Entity “Retrieves Customer by ID”.
- Path is the path parameter of the url. For example the {id}.
- Query is defined set of parameters attached to the end of a url.
Example: www.url.com?type=true&start=0
We can add the id into Path in the Request Parameters and Alumio will request with URL /admin/customers/123
Input Transformer
Any transformer’s set here will be executed after the Request Parameters loaded. So, you basically can add any transformer to provide and transform the request parameters into anything you need, either as path parameters and/or as query parameters of an entity.
HTTP Client
It’s the HTTP Client configuration or prototype you will use to access Sylius.
3. Publishing entity to Sylius
3.1 Steps
- Go to Connections → Outgoing, create a new outgoing configuration and select Sylius Publisher as the publisher.
- Select the action that you want the publisher to do with the data.
- Select the Sylius entity you want the data to be published to.
- You can optionally add any query parameters to the request.
- You can also optionally add any transformers to transform the data into anything you need before submitting it to Sylius.
- Select the HTTP Client to use.
3.2 General Concept
Like the subscriber, the publisher has similar methods on how to use it. The difference is the payload that will be submitted by the publisher originating from the data (from routes, from transformers in outgoing configuration), though you can also add or modify payload using the Request Transformer.
Action
Currently we support Create (HTTP POST method), Update (HTTP PUT method) and Delete (HTTP DELETE method) entity.
Entity
We support publishing to most Sylius endpoints. Please refer to the entities from Sylius API Reference page. Based on the documentation, some endpoints may need one or more path parameters.
For example when we want to create a product, we select the Action “Create” and the Entity “Product”.
We also need to provide payload in the data like
- Path is the path parameter of the url. For example the {id}.
- Query is defined set of parameters attached to the end of a url.
Example: www.url.com?type=true&start=0 - Payload is the data contained within a request.
Alumio will request this to Sylius with the URL /admin/products
HTTP Client
It’s the HTTP Client configuration or prototype you will use to access Sylius.