cancel
Showing results for 
Search instead for 
Did you mean: 

Pay-as-you-go / trial account limitations - token access

Image Sensor

I am attempting to get a token for API connectivity via Python using the advice posted here, but am unable to share a project, and am now wondering whether I can even use the API in the Pay-as-you-go / trial mode.  I formerly used a corporate DataRobot license and accessed the API using R and had no trouble.  

0 Kudos
8 Replies
DataRobot Employee
DataRobot Employee

Jonathan,

Thanks for reaching out to us. We do not have sharing in the trial. Here is the info you need for API access. I've cut-and-pasted the info and also provided you the link to the longer trial FAQ.

https://community.datarobot.com/t5/ai-platform-trial/getting-started-in-the-ai-platform-trial/m-p/70...

Q. Can I use code like R/Python to interact with DataRobot during the trial?

A: Yes, the trial fully supports API access. DataRobot is accessible via API (see the developers site). There is also an R client and a Python client, with lots of examples on our community GitHub.

If you have additional questions, please let us know.

Thanks,

Tricia Lee

0 Kudos
Image Sensor

Thanks, Tricia.  I am glad to hear API access is supported.  I still don't understand the specific, click-by-click steps I need to follow in order to get a token.  In Ganeshuv's two recommendations from the linked message....

1. You can find the token by right-clicking "Open" button -> Copy Link Address from the current applications in the DataRobot app (I can't find an Open button....is he referring to the DataRobot interface, e.g. https://app2.datarobot.com/manage-projects)

2. You can find the same link from a share button (in top right) in the launched app in your browser.  (per your reply, I can't share in the trial, so this method is off-limits to me).  

I think this must be the kind of thing that's so obvious to salty developers that it doesn't need explicit clarification.  Thanks for your patience and guidance.

0 Kudos
DataRobot Employee
DataRobot Employee

I think there is some confusion here in regards to that linked conversation you are referencing, as those are application tokens (hosted mini apps inside the platform) rather than a user API token, which is what you are looking for.  I believe it is the same on AI Trial as the standard DataRobot account, where you would find it under your profile (top right person icon) options, under the Developer Tools heading.

0 Kudos
Image Sensor

You're absolutely right....I was confused about the applicability of that reply.  But when I go to the page you reference, (screencapped below but with API key obscured for security) I don't see anything related to "tokens."  Do I need to click further, or do they exist under some other name, or is this functionality disabled for me, or is something else going on?  

Jonathan-Isernhagen_1-1609591211086.png

Sorry if it's obvious and I'm just being clueless.

 

0 Kudos
DataRobot Employee
DataRobot Employee

No worries!  Perhaps a bit confusing swapping similar names, but API key/token is the same thing here, as the part of the image you blocked off is what you're after for interacting with DataRobot programmatically through the API and R/Python SDK clients.  Note you can delete/generate new ones as well.

Image Sensor

This is very helpful....I'm making progress.  When I try to run:

import datarobot as dr

dr.Client(token='[the API key which I got from the developer tools page]', endpoint='https://app.datarobot.com/api/v2')

...per the Getting Started instructions here, I get the following error:

"C:\Users\Jonathan Isernhagen\PycharmProjects\DataRobot\venv\Scripts\python.exe" "C:/Users/Jonathan Isernhagen/PycharmProjects/DataRobot/main.py"
C:\Users\Jonathan Isernhagen\PycharmProjects\DataRobot\venv\lib\site-packages\datarobot\client.py:125: UserWarning: Unable to authenticate to the server - are you sure the provided token of "[I'm obscuring the key here as well for security]" and endpoint of "https://app.datarobot.com/api/v2" are correct? Note that if you access the DataRobot webapp at `https://app.datarobot.com`, then the correct endpoint to specify would be `https://app.datarobot.com/api/v2`.
warnings.warn(w_msg_tmpl.format(client.endpoint))

Process finished with exit code 0

I'm also a little perplexed as to why the process is finishing with exit code 0 in what looks like a 1 situation, but mostly I'm hoping to authenticate successfully.  Thanks for your ongoing guidance, especially on a weekend after New Years when you may or may not still be hung over.

0 Kudos
DataRobot Employee
DataRobot Employee

You are quite close!  Most examples will be to app, the trial is hosted on a separate instance; you will see in your URL that it is app2 that you are connecting to.  Try that and I think you will be set.

As far as the return code, my guess is it is going to be something along the lines of the python SDK wrapping a http request call that erred with some non-200 level success status; maybe a 403; which the SDK then caught and displayed that message.  After which it did not throw anything further, and the 0 is from the python.exe saying "I've finished running all of the python!"

Image Sensor

BAM!  That did it.  Thanks for your patience and tenacity.  I really appreciate your help.

DataRobot has superior customer service.