Jump to content
stephenp

Automate API

Recommended Posts

Hi. Was wondering if anyone has got the automate API to work for a hosted Automate install? I'm trying to grab data automatically from the automate database and as we are hosted can't use ODBC.

Hoping even if someone has a small c# sample they could share? I've read the documentation but it didn't give me any luck unfortunately.

Share this post


Link to post
Share on other sites

Probably to expand on where I am having issues. I'm using (https://developer.connectwise.com/Products/Automate/REST/API_Model#/APIToken/APIToken_Post1) and (https://developer.connectwise.com/Products/Automate/REST) as some guides. I'm also using https://apitester.com/ to test the API calls.

I'm not able to get an authentication key, so not able to get much further. 

I'm hitting https://mysite.hostedrmm.com/cwa/api/v1/apitoken with my username/password but getting an "Access is denied due to invalid crednetials". I know the username/password is correct and I have "super admin" user class and should be able to get to everything afaik.

 

Share this post


Link to post
Share on other sites

Sounds strange.

I'm using the "Restlet Client"-plugin for Google Chrome for tests.

Hitting https://our.domain/cwa/api/v1/apitoken with the following POST:

Header:
Content-Type application/json

Body:
{
   "username":"username",
   "password":"password"
}

If you're using 2FA with Google Authentication, you have to use the following Body:

Body:
{
   "username":"username",
   "password":"password"
   "TwoFactorPasscode":"Cod3"
}

This works like a charm.

Share this post


Link to post
Share on other sites

Thanks Peter.

I've ended up getting this working. I think the username I was using didn't have the right permissions. 

Using PostMan was the best way to get it going. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...