Skip to content

Instantly share code, notes, and snippets.

@DhruvaDave
Created December 19, 2020 14:05
Show Gist options
  • Save DhruvaDave/fc371f905638a4bab9ea6f5c2a0add9f to your computer and use it in GitHub Desktop.
Save DhruvaDave/fc371f905638a4bab9ea6f5c2a0add9f to your computer and use it in GitHub Desktop.
def get_folder_with_query_parameters(self,token, item_id,folder_name):
uri_path = '/sf/v3/Users/AllSharedFolders'
headers = self.get_authorization_header(token)
http = httplib.HTTPSConnection(self.get_hostname(token))
http.request('GET', uri_path, headers=headers)
response = http.getresponse()
if response.status == 200:
data = json.loads(response.read())
for name in data['value']:
if name['Name'] == folder_name:
return name['Id']
self.env.cr.commit()
http.close()
else:
http.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment