Authentication failed with utility api authorization

I have an account on the beta.ecobee.com server with a thermostat attached. I am able to log in to the portal. I have also been told through email that I have been given "utility api authorization". I've also been given the pdf describing how to use this authentication method.

However, when I attempt to authenticate via cURL, I receive the following response:


{
"status": {
"code": 1,
"message": "Authentication failed."
}
}


I'm not sure if it's appropriate to post the cURL command on this forum, as this access method is marked as confidential. However, I can provide the full command and verbose output, as well as the credentials I'm using, if necessary.
1 person has
this question
+1
Reply
  • ScottF (Official Rep) March 21, 2014 11:57
    Hi Samuel,
    Can you please post your actual cURL request (masking out the username and password) and the full response you get back please?

    Please also make sure to run that cURL command with the verbose option.
    That way we can investigate further.

    Thanks,
    Scott
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • I’m performing the following command in cURL:


    Curl -v -k POST --data-urlencode @auth.txt -H "Content-Type: application/json" --proxy proxy.etn.com:8080 https://api.ecobee.com/1/register?format=json


    The @auth.txt file contents:


    {
    "userName":"xxxxx@Eaton.com",
    "password":"xxxxx"
    }


    Verbose output from cURL:

    C:\ecobee>Curl -v -k POST --data-urlencode @auth.txt -H "Content-Type: applicati
    on/json" --proxy proxy.etn.com:8080 https://api.ecobee.com/1/register?format=jso
    n
    * Rebuilt URL to: POST/
    * Hostname was NOT found in DNS cache
    * Trying 151.110.126.120...
    * Connected to proxy.etn.com (151.110.126.120) port 8080 (#0)
    > POST HTTP://POST/ HTTP/1.1
    > User-Agent: curl/7.35.0
    > Host: POST
    > Accept: */*
    > Proxy-Connection: Keep-Alive
    > Content-Type: application/json
    > Content-Length: 127
    >
    * upload completely sent off: 127 out of 127 bytes
    < HTTP/1.1 503 Service Unavailable
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Type: text/html; charset=utf-8
    < Proxy-Connection: Keep-Alive
    < Connection: Keep-Alive
    < Content-Length: 760
    <

    Network Error




    Network Error (dns_server_failure)


    Your request could not be processed because an error occurred contacting the DNS
    server.

    The DNS server may be temporarily unavailable, or there could be a network probl
    em.


    For assistance, contact your network support team.



    * Connection #0 to host proxy.etn.com left intact
    * Hostname was found in DNS cache
    * Trying 151.110.126.120...
    * Connected to proxy.etn.com (151.110.126.120) port 8080 (#1)
    * Establish HTTP proxy tunnel to api.ecobee.com:443
    > CONNECT api.ecobee.com:443 HTTP/1.1
    > Host: api.ecobee.com:443
    > User-Agent: curl/7.35.0
    > Proxy-Connection: Keep-Alive
    > Content-Type: application/json
    >
    < HTTP/1.1 200 Connection established
    <
    * Proxy replied OK to CONNECT request
    * SSLv3, TLS handshake, Client hello (1):
    * SSLv3, TLS handshake, Server hello (2):
    * SSLv3, TLS handshake, CERT (11):
    * SSLv3, TLS handshake, Server key exchange (12):
    * SSLv3, TLS handshake, Server finished (14):
    * SSLv3, TLS handshake, Client key exchange (16):
    * SSLv3, TLS change cipher, Client hello (1):
    * SSLv3, TLS handshake, Finished (20):
    * SSLv3, TLS change cipher, Client hello (1):
    * SSLv3, TLS handshake, Finished (20):
    * SSL connection using DHE-RSA-AES256-GCM-SHA384
    * Server certificate:
    * subject: serialNumber=MfHRyB51b6Wesc6mvTK0-eZuWKmG-Zlr; OU=GT94543573;
    OU=See www.geotrust.com/resources/cps (c)13; OU=Domain Control Validated - Quick
    SSL(R); CN=api.ecobee.com
    * start date: 2013-11-25 07:52:19 GMT
    * expire date: 2015-02-27 01:51:39 GMT
    * issuer: C=US; O=GeoTrust Inc.; OU=Domain Validated SSL; CN=GeoTrust DV
    SSL CA
    * SSL certificate verify result: unable to get local issuer certificate (
    20), continuing anyway.
    > POST /1/register?format=json HTTP/1.1
    > User-Agent: curl/7.35.0
    > Host: api.ecobee.com
    > Accept: */*
    > Content-Type: application/json
    > Content-Length: 127
    >
    * upload completely sent off: 127 out of 127 bytes
    < HTTP/1.1 500 Internal Server Error
    < Date: Wed, 19 Mar 2014 20:45:24 GMT
    * Server Apache-Coyote/1.1 is not blacklisted
    < Server: Apache-Coyote/1.1
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Type: application/json;charset=UTF-8
    < Via: 1.1 api.ecobee.com
    < Vary: Accept-Encoding
    < Connection: close
    < Transfer-Encoding: chunked
    <
    {
    "status": {
    "code": 1,
    "message": "Authentication failed."
    }
    }* Closing connection 1
    * SSLv3, TLS alert, Client hello (1):

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Hi Samuel,

    Your requests are not going to the beta environment, and you are instead sending requests to the ecobee production environment, where your Utility account does not exist. Instead of using api.ecobee.com as your URL you must use beta.ecobee.com to connect to the beta environment. This will resolve your current authorization problem.

    Also, it looks like your proxy is causing errors in between your communication between your cURL client and our end. These errors may end up causing problems with your future API requests, either causing them to time out, or returning false error responses that are coming from your proxy and not our servers.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • When I attempt to connect to
    https://beta.ecobee.com/1/register?format=json
    I get an html response - the default 404 page for the ecobee site.

    I have tried this on my work network (with proxy) and on an outside network (without proxy). Same result either way.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Hi Samuel,

    You are using the incorrect URL. The URL's for production and beta environments are located in our documentation here https://www.ecobee.com/home/developer...

    In the request you posted above you are missing the /home/api/ segments of the beta environment API URL.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Thanks, I missed that additional segment for the beta server. Query is working correctly now.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • I always get unauthorized error using below api url. Please help.

    POST: https://api.ecobee.com/1/register?for...=

    Request Body: {
    "client_id": ,
    "scope": "smartWrite",
    "userName": ,
    "password":
    }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated