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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×