Skip to content

Commit 4b4635c

Browse files
Merge pull request #99 from jeremydmorris/oauth-fix
Oauth fix
2 parents 9bece68 + 59a8d20 commit 4b4635c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pydomo/Transport.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def _renew_access_token(self):
8686
self.logger.debug("Renewing Access Token")
8787
request_args = {
8888
'method': HTTPMethod.POST,
89-
'url': self.apiHost + '/oauth/token?grant_type=client_credentials',
89+
'url': self.apiHost + '/oauth/token',
90+
'data': {'grant_type': 'client_credentials'},
9091
'auth': HTTPBasicAuth(self.clientId, self.clientSecret)
9192
}
9293
if self.request_timeout:

pydomo/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from io import StringIO
1818
import logging
1919
import json
20+
import csv
2021

2122
DOMO = """####################################################################################################
2223
####################################################################################################
@@ -205,6 +206,12 @@ def ds_get(self, dataset_id):
205206
pass
206207

207208
return df
209+
210+
def ds_get_dict(self,ds_id):
211+
my_data = self.datasets.data_export(ds_id,True)
212+
dr = csv.DictReader(StringIO(my_data))
213+
data_list = list(dr)
214+
return(data_list)
208215

209216
def ds_create(self, df_up, name, description='',
210217
update_method='REPLACE', key_column_names=[]):

0 commit comments

Comments
 (0)