Parameters
Webhooks
AFS Energy Portal uses webhooks to let your application know when events happen such as updating of price.
List of events
You should provide only events that are specified in the table below.
| Name | Description |
|---|---|
| price_updated | Offer that contains price has been created and will be sent to the client |
Object structure
| Property | Type | Description | Nullable |
|---|---|---|---|
| id | String | UUID | No |
| url | String | AFS Energy Portal will use this url to send request to client after certain event occurs | No |
| event | String | Name of event. See list of events. | No |
POST Create a Webhook
This endpoint allows you to create a Webhook.
Request header should contain Content-Type: application/json and Accept: application/json.
Request body
| Property | Type | Description | Nullable |
|---|---|---|---|
| url | String | AFS Energy Portal will use this url to send request to client after certain event occurs | No |
| event | String | Name of event. See list of events. | No |
Example:
{ "url": "string", "event": "price_updated"}Responses
See Webhook structure.
Example:
{ "id": "string", "url": "string", "event": "price_updated"}GET Retrieve all Webhooks
This endpoint allows you to retrieve the list of Webhooks.
Parameters
Request header should contain Accept: application/json.
Responses
See Webhook structure.
Example:
[ { "id": "string", "url": "string", "event": "price_updated" }]GET Retrieve the Webhook
This endpoint allows you to retrieve the Webhook by id.
Parameters
| Property | Type | Description | Nullable |
|---|---|---|---|
| id | String | UUID | No |
Request header should contain Content-Type: application/json.
Responses
See Webhook structure.
Example:
{ "id": "string", "url": "string", "event": "price_updated"}PUT Replace the Webhook
This endpoint allows you to replace the Webhook by id.
Parameters
| Property | Type | Description | Nullable |
|---|---|---|---|
| id | String | UUID | No |
Request header should contain Content-Type: application/json and Accept: application/json.
Request body
| Property | Type | Description | Nullable |
|---|---|---|---|
| url | String | AFS Energy Portal will use this url to send request to client after certain event occurs | No |
| event | String | Name of event. See list of events. | No |
Example:
{ "url": "string", "event": "price_updated"}Responses
Request by price_updated event
Offer that contains price was created so the price_updated event occurred. AFS Energy Portal will send a request with Offer details to the client endpoint using url that was saved in the Webhook resource.
Parameters
Request header will contain Content-Type: application/json.
Request body
| Property | Type | Description | Nullable |
|---|---|---|---|
| id | String | International Resource Identifier of Offer | No |
| price | Float | Price per volume | No |
| totalPrice | Float | Notional price | No |
| currency | String | Currency code, for example, EUR or GBP | No |
| createdAt | String | Date and time of Offer creation. Atom format (Y-m-d\TH:i:sP ) | No |
Example:
{ "ioiIri": "/api/iois/1eef674e-3698-6450-82fb-5922191c8bd3" "offerIri": "/api/offers/1eef674e-3698-6450-82fb-5922191c8aa1", "price": 100.55, "totalPrice": 10005.5, "currency": "EUR", "createdAt": "2024-03-28T12:36:17+00:00"}Responses
AFS Energy Portal expects successful response code 200.