SWITCHGRID

Getting started with API v0.1

🚧
This document is WIP. This API is still beta, please reach us at [email protected] or via Slack if you have questions.
 
This is a guide to using our API /v0_1. There is also an OpenAPI specification available.
Api is accessible at path api.switchgrid.tech/v0_1.
ℹ️
API /v0_1 is the first version of Switchgrid’s API that supports other DSOs (Distribution System Operator) than Enedis. The first supported DSO is GRDF.
 
 
⚠️
The following API endpoints are still on api.switchgrid.tech/enedis/v2 :
  • GET /search_contract - search for an Enedis electricity contract
  • POST /order - post an order for Enedis
We will progressively provide endpoints that match this functionality in /v0_1 but as of now, asks (consents) created with /v0_1 can be used with /enedis/v2 orders. See
Migration from /enedis/v2 to /v0_1
details.
See
API Switchgrid Enedis
for documentation of the Enedis-specific api.

Auth

All calls are made with an authentication header Authorization: Bearer <Token>. Tokens can be created / rotated via the interface https://app.switchgrid.tech.
⚠️
Caution, this API token is a secret. It allows you to request Enedis consumption data. It is therefore advised not to reveal it, and thus to make API calls from a server, not from the browser or a mobile client.
 

Create your first Ask

This is an example of the body of POST /v0_1/ask an Ask with a gas contract, and an electricity contract coming from GET /enedis/v2/search_contract.
 
{ "contracts": [ "5a03cc9d-16d3-4045-b540-a0a0a0deda11", // Contract from GET /enedis/v2/search_contract { "_energyType": "gas", "deliveryPointId": "00000000000001", "holder": { "_tag": "NaturalPerson", "fullName": "Jean Dupont" }, "address": { "rueEtNumero": "17 avenue Charles de Gaulle", "codePostal": "75007", "commune": "Paris" } } ], "consentDuration": "1 day" }
body of POST /v0_1/ask

Order data

Order with GRDF

For ordering daily indices from GRDF, use the following.
ℹ️
Terminology: Here we use the term pce instead of deliveryPointId because this endpoint is grdf-specific, and that’s the vocabulary of GRDF.
 
{ "pce": "00000000000001" }
body of POST /v0_1/integration/grdf-adict/donnees-informatives
 

Order with Enedis

It’s still required to use /enedis/v2 for that. You have to use the order syntaxt with prms in every request.
ℹ️
Note to early Switchgrid users :
No need to specify a consentId, we automatically look for matching Asks in both the old and new APIs.
 
{ "requests": [ { "type": "LOADCURVE", "direction": "CONSUMPTION", "prms": ["00046372994792", "00052989142094"] }, { "type": "C68_ASYNC", "direction": "CONSUMPTION", "prms": ["00046372994792", "00052989142094"] } ] }
Example of POST /enedis/v2/order

Useful docs

Migration from /enedis/v2 to /v0_1