Repository navigation
CURL Example #66
Replies: 2 comments 3 replies
|
Thanks, I retrieve the access token then run another curl request, and at that point, I do not retrieve a json response. I was able to get a response for archives, document links, etc. But not with public reports. I verified registration this morning, and still no response. (ie) https://api.ercot.com/api/public-reports/NP4-732-CD/wpp_hrly_avrg_actl_fcast I pass headers for subscription key, and access token in a CURL request and receive no response. I responded with my code in another link already. #34 (reply in thread) |
|
Hello, I'm trying to request np3-965-er/60_sced_gen_res_data through CURL but nothing I've tried is working. I know it's the structure of the parameters but I don't know how to fix it. I've had success with the np4-190-cd/dam_stlmnt_pnt_prices. Any ideas what I am doing wrong? THIS WORKS THIS DOES NOT WORK THIS ALSO DOES NOT WORK |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
You will need your login username and password as well as your subscription key for your ERCOT API Account.
Get an Authentication Token
POST (not get) the ENTIRE request below for a token, make sure to update the following URL with the username and password. Yes, scope and client_id are required, NO they do not change.
curl --location --request POST "https://ercotb2c.b2clogin.com/ercotb2c.onmicrosoft.com/B2C_1_PUBAPI-ROPC-FLOW/oauth2/v2.0/token?username=************&password=************&grant_type=password&scope=openid+fec253ea-0d06-4272-a5e6-b478baeecd70+offline_access&client_id=fec253ea-0d06-4272-a5e6-b478baeecd70&response_type=id_tokenThis will return a JSON document
Now you are ready to make calls to the report.
curl --location --request GET "https://api.ercot.com/api/public-reports/np6-346-cd/act_sys_load_by_fzn?operatingDayFrom=2023-01-01&operatingDayTo=2023-12-31" --header "Host: api.ercot.com" --header "Accept: application/json" --header "Ocp-Apim-Subscription-Key: **YOUR*SUBSCRIPTION*KEY*FROM*ACCOUNT**" --header "Authorization: Bearer ***id_token_from_above***"Important: Most applications will automatically generate the Host header for you, without it the server responds with a 503.
Important: If you modify the client_id in the token request you will get a 400 error stating that the client id is not registered in the tenant.
Important: The report URL is all lowercase... if you use an uppercase emil id, eg NP6-346-CD in the URL, you will get a 404.
All reactions