Kommuniker med DataHub3 PREPROD i 3 steps:
1. Client secret
Hvis I kender jeres "Client Id/Client secret" så spring dette step over!
Naviger til DataHub 3 klienten (PREPROD) og log ind. https://www.preprod.datahub3.dk
Naviger til Aktør-fanen (eller via dette link: https://preprod.datahub3.dk/market-participant/actors
Vælg fanen ‘B2B adgang’ og træk jeres Client ID og generer Client secret
Gem Client Id og Client Secret.
2. Bearer token
Kald endpoint for at få udleveret bearer token
[POST] https://login.microsoftonline.com/20e7a6b4-86e0-4e7a-a34d-6dc5a75d1982/oauth2/v2.0/token
[Required Header]
Content-Type: application/x-www-form-urlencoded
[Body]
grant_type=client_credentials&client_id={{Client Id fra step 1}}&client_secret={{Client Secret fra step 1}}&scope=65877f1b-1aef-42b3-adc7-3009608f27a3%2F.default
Så returneres bearer token i jeres svar.
Vær opmærksom på, at bearer token har en kort levetid på 1 time.
3. Kald Peek
[GET] https://preprod.b2b.datahub3.dk/v1.0/cim/aggregations
[Required Header]
Content-Type: application/json
Authorization: Bearer {{Bearer token fra step 2}}
Header Content-Type kan enten være application/json eller application/xml
Dequeue
[DELETE] https://preprod.b2b.datahub3.dk/v1.0/cim/dequeue/{message-id}
[Required Header]
Authorization: Bearer {{Bearer token fra step 2}}
Request aggregated measure data
[POST] https://preprod.b2b.datahub3.dk/v1.0/cim/requestaggregatedmeasuredata
[Required Header]
Content-Type: application/json
Authorization: Bearer {{Bearer token fra step 2}}
[Body]
Body skal indeholde en skema valid RSM-014 enten i XML eller Json. Her et et eksempel på XML:
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2021 rel. 3 (x64) (http://www.altova.com )-->
<cim:RequestAggregatedMeasureData_MarketDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cim="urn:ediel.org:measure:requestaggregatedmeasuredata:0:1" xsi:schemaLocation="urn:ediel.org:measure:requestaggregatedmeasuredata:0:1 urn-ediel-org-measure-requestaggregatedmeasuredata-0-1.xsd">
<cim:mRID></cim:mRID>
<cim:type>E74</cim:type>
<cim:process.processType>D03</cim:process.processType>
<cim:businessSector.type>23</cim:businessSector.type>
<cim:sender_MarketParticipant.mRID codingScheme="A10"></cim:sender_MarketParticipant.mRID>
<cim:sender_MarketParticipant.marketRole.type></cim:sender_MarketParticipant.marketRole.type>
<cim:receiver_MarketParticipant.mRID codingScheme="A10">5790001330552</cim:receiver_MarketParticipant.mRID>
<cim:receiver_MarketParticipant.marketRole.type>DGL</cim:receiver_MarketParticipant.marketRole.type>
<cim:createdDateTime>2022-12-17T09:30:47Z</cim:createdDateTime>
<cim:Series>
<cim:mRID></cim:mRID>
<!-- <cim:settlement_Series.version>D01</cim:settlement_Series.version> -->
<cim:marketEvaluationPoint.type>E17</cim:marketEvaluationPoint.type>
<cim:marketEvaluationPoint.settlementMethod>D01</cim:marketEvaluationPoint.settlementMethod>
<cim:start_DateAndOrTime.dateTime>2023-01-01T23:00:00Z</cim:start_DateAndOrTime.dateTime>
<cim:end_DateAndOrTime.dateTime>2022-01-22T23:00:00Z</cim:end_DateAndOrTime.dateTime>
<cim:meteringGridArea_Domain.mRID codingScheme="NDK">804</cim:meteringGridArea_Domain.mRID>
<!--<cim:energySupplier_MarketParticipant.mRID codingScheme="A10"></cim:energySupplier_MarketParticipant.mRID>-->
<cim:balanceResponsibleParty_MarketParticipant.mRID codingScheme="A10"></cim:balanceResponsibleParty_MarketParticipant.mRID>
</cim:Series>
</cim:RequestAggregatedMeasureData_MarketDocument>