Domo instance API - Method Not Allowed

We want to interact with our Domo instance via scripting namely for triggering a Magic ETL or MySQL dataflow. We noticed that there is a way to interact with the API for our Domo instance by using first an authentication method.

However, when we tried to use that method (either in Python scripting or in Postman) it returns the message of "Method Not Allowed" when we were expecting a successful message with a session token.

Notice that we are trying to connect to "our_domo_instance.domo.com" and not to "api.domo.com"

What could be the possible cause? Are we missing here some security requirement that has to be configured?

Thank you

Tagged:

Best Answer

  • jaeW_at_Onyx
    jaeW_at_Onyx Coach
    Answer ✓
    export const get_authToken_domo = async (EMAIL, PASSWORD, DOMO_INSTANCE) => {
      const auth_url = `https://${DOMO_INSTANCE}.domo.com/api/content/v2/authentication`;
    
    
      const body = {
        method: 'password',
        emailAddress: EMAIL,
        password: PASSWORD,
      };
    
    
      let resp = await fetch(auth_url, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(body),
      });
    
    
      const data = await resp.json();
      return data.sessionToken;
    };
    
    
    

    just tested. this works.

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"

Answers

  • I believe you need to start using the client ID and secret with OAuth 2.0 in order to connect now. You may want to review this page:


    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • Hi @Fatias

    If you're trying to connect to your_instance.domo.com you'd need an authenticated API key and pass that into the 'X-DOMO-Developer-Token' header. This is how you can authenticate with your instance APIs and not the api.domo.com APIs. You can generate a token under Admin -> Authentication -> Access Tokens.

    This will authenticate your requests to the different API endpoints based upon the user who created the Access Token.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • jaeW_at_Onyx
    jaeW_at_Onyx Coach
    Answer ✓
    export const get_authToken_domo = async (EMAIL, PASSWORD, DOMO_INSTANCE) => {
      const auth_url = `https://${DOMO_INSTANCE}.domo.com/api/content/v2/authentication`;
    
    
      const body = {
        method: 'password',
        emailAddress: EMAIL,
        password: PASSWORD,
      };
    
    
      let resp = await fetch(auth_url, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(body),
      });
    
    
      const data = await resp.json();
      return data.sessionToken;
    };
    
    
    

    just tested. this works.

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • Fatias
    Fatias Member

    Thanks @jaeW_at_Onyx

    I was doing the same procedure in Python but probably had some typo because I copy paste your endpoint and the other text and it is working now!

    Just a side note: we have our Domo instance connected with our identity provider to allow Single Sign-On (SSO) and we noticed that the password that works under the body of the request is the password stored internally in Domo and not the password from our identity provider.

  • @Fatias true, i believe you would have to have the direct sign on exception enabled to use this method.

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • @Fatias @jaeW_at_Onyx I am trying to implement this as well and we also have SSO enabled, how would i get the password needed for the body

  • @Jmoreno if you are using the full auth snippet I provided, you have to use your Domo password (not your identity provider password) AND you have to have direct sign on enabled.


    If you are not able to use that approach, @GrantSmith 's response was correct, you have to authenticate using x-domo-developer-token


    https://www.youtube.com/watch?v=Qy0aXeJWSlI&t=7s

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • @jaeW_at_Onyx Thanks for the help. I was able to get my admin to enable direct sign-on for me and that solved the issue and everything is working fine.


    Love the channel and videos by the way, SUPER HELPFUL!!