- Previous: How to get an Access Token
- Up: How to register
- Next: Glossary
How to make a request
Retrieve an Access Token
Please refer to the following examples in order to send a POST for retrieving an Access Token.
JavaScript - Fetch
var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/x-www-form-urlencoded"); var urlencoded = new URLSearchParams(); urlencoded.append("grant_type", "client_credentials"); urlencoded.append("client_id", "your_API_Key"); urlencoded.append("client_secret", "your_API_Secret"); var requestOptions = { method: 'POST', headers: myHeaders, body: urlencoded, redirect: 'follow' }; fetch("https://api.terna.it/public-api/access-token", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
Calling our APIs
JavaScript - Fetch
var myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer n3fujtnubkgx48rhvcf7yxz7"); var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow' }; fetch("https://api.terna.it/transparency/v1.0/gettotalload?dateFrom=10/05/2022&dateTo=11/05/2022", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
- Previous: How to get an Access Token
- Up: How to register
- Next: Glossary
Docs Navigation
- How to register
- How to create an application
- How to get an Access Token
- How to make a request
- Glossary
- APIs Catalog
- Adequacy
- Fees
- Generation
- Actual Generation
- Renewable Generation
- Energy Balance
- Installed Capacity
- Wind Production Forecast
- Renewable Source Capacity
- Generation Plants
- Thermoelectric Capacity
- Electrical Energy By Source
- Renewable Sources Production
- Hydric
- Gross vs CO2 emissions per fuel
- Thermoelectric Production
- Thermoelectric Heat
- Load
- Market
- Outages
- Transmission