A PQ can now be created using the ID of the unit. The following request is used to create a PQ for the reserve unit: Code Block |
---|
curl -X 'POST' \
'https://training.pq-portal.energy/pqapi/data/v1/reserve-units/{id}/prequalifications' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <accessToken>' \
-H 'Content-Type: application/json' \
-d '{
"reserveType": "FrequencyContainmentReserve", <--- mandatory
"reserveDirection": "Negative", <--- mandatory
"requestedMeasurement": { <--- not mandatory
"reactionTime": ...,
"deliveryDuration": ...,
"fullLoadHours": ...,
"power": ...,
"marketablePower": ...,
"powerSlewRate": ...
}
}' |
The information on the reserve type and the reserve direction is mandatory. The requested measurements do not necessarily have to be specified. Important: There must be no existing PQ of the same type and direction for this unit. Note: An overview of mandatory fields can be found at the end of the Swagger documentation. The schemas below show the last endpoint definition and apply across all endpoints. The mandatory information is marked with a red asterisk:  After the request has been made the response body contains the GUID of the new PQ: Code Block |
---|
{
"id": "........-....-....-....-............"
} |
This step If a typing error occurs when entering one of the mandatory fields, the error message will inform you of this. In the following example, the “e” at the end of the “Negative” reserve direction is forgotten. Code Block |
---|
[...]
{
"domain": "Pq_Api",
"category": "RequestValidation",
"errorCode": "DataTransferObjectNotValid",
"message": "The reserveDirection must be of type Lotes.PQ.Api.Applications.Models.Enumerations.ReserveDirection",
"contextType": "Field",
"context": {
"fieldName": "reserveDirection",
"typeName": "FieldValidationContext"
}
}
[...] |
Creating a PQ for a reserve group can be carried out in the same way with an as a reserve groupunit: Code Block |
---|
curl -X 'POST' \
'https://training.pq-portal.energy/pqapi/data/v1/reserve-groups/{id}/prequalifications' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <accessToken>' \
-H 'Content-Type: application/json' \
-d '{
"reserveType": "FrequencyContainmentReserve",
"reserveDirection": "Negative",
"requestedMeasurement": { <--- not mandatory
"reactionTime": ...,
"deliveryDuration": ...,
"fullLoadHours": ...,
"power": ...,
"marketablePower": ...,
"powerSlewRate": ...
}
}' |
The response body of the reserve group is identical to the reserve unit. For example, if the GUID is not known to the system, the following error is displayed. Code Block |
---|
{
"statusCode": 404,
"domain": "Pq_Api",
"category": "Business",
"errorCode": "ResourceNotFound",
"message": "Resource not found.",
"reasons": [
{
"domain": "Pq_Api",
"category": "Business",
"errorCode": "ReserveResourceDoesNotExist",
"message": "The reserve resource 93897c75-7417-4c57-99d6-ba0fb6c2f545 does not exist.",
"contextType": "Reference",
"context": {
"id": "93897c75-7417-4c57-99d6-ba0fb6c2f545",
"typeName": "ReferenceContext"
}
}
]
} |
The 'message' parameter specifies what the problem is. In this case, the GUID does not exist. It must be an input error. |