Example #1
0
def getRecords(module):
    url = 'https://www.zohoapis.com/crm/v2/{module_id}?per_page=1'
    # url = 'https://www.zohoapis.com/crm/v2/{module_id}/3490721000001139001/Products'
    # url = 'https://www.zohoapis.com/crm/v2/{module_id}/3490721000000519039'
    # url = 'https://www.zohoapis.com/crm/v2/{module_id}/search?per_page=3&criteria=(Owner.name:starts_with:Scott)'
    # url = 'https://www.zohoapis.com/crm/v2/{module_id}/search?per_page=3&criteria=(Owner.id:equals:3490721000000175021)'
    # url = 'https://www.zohoapis.com/crm/v2/{module_id}/search?per_page=3&criteria=(Full_Name:equals:Paul Trinidad)'
    # url = 'https://www.zohoapis.com/crm/v2/{module_id}/search?per_page=3&criteria=(Created_By.id:equals:3490721000000253001)'
    # url = 'https://www.zohoapis.com/crm/v2/{module_id}/search?per_page=3&criteria=(Custom_Number:greater_than:1)'
    # url = 'https://www.zohoapis.com/crm/v2/{module_id}/search?per_page=3&criteria=(Custom_Date:less_than:2018-10-31T15:00:00-05:00)'
    url = url.replace("{module_id}", module)
    headers = {
        'Authorization': tokens.getAccess(), 
        # 'If-Modified-Since': '2018-10-02T17:38:49-05:00',
        # 'If-Created-Since': '2018-10-22T17:38:49-05:00',
        }

    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #2
0
def getRecords():
    url = 'https://desk.zoho.com/api/v1/organizations'
    headers = {
        'Authorization': tokens.getAccess(),
    }
    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #3
0
def getRecords(module):
    url = 'https://www.zohoapis.com/crm/v2/settings/fields?module={module_id}'
    url = url.replace("{module_id}", module)
    headers = {
        'Authorization': tokens.getAccess(),
    }
    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #4
0
def getRecords(organizationId):
    url = 'https://desk.zoho.com/api/v1/profiles?visible=true'
    headers = {
        'orgId': organizationId,
        'Authorization': tokens.getAccess(),
    }
    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #5
0
def getRecords(module):
    url = 'https://projectsapi.zoho.com/restapi/portals/'
    headers = {
        'Authorization': tokens.getAccess(),
    }

    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #6
0
def getRecords(organizationId):
    url = 'https://desk.zoho.com/api/v1/tickets?include=contacts'
    headers = {
        'orgId': organizationId,
        'Authorization': tokens.getAccess(),
    }
    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #7
0
def getRecords(organizationId):
    url = 'https://desk.zoho.com/api/v1/myinfo?include=profile,role,associatedDepartments,associatedChatDepartments'
    headers = {
        'orgId': organizationId,
        'Authorization': tokens.getAccess(),
    }
    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #8
0
def getRecords(organizationId):
    url = 'https://desk.zoho.com/api/v1/tickets/search?subject={searchString}'
    url = url.replace("{searchString}", searchString)
    headers = {
        'orgId': organizationId,
        'Authorization': tokens.getAccess(),
    }
    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #9
0
def getRecords(organization_id):
    url = 'https://books.zoho.com/api/v3/contacts?organization_id={org_id}&per_page=3'
    url = url.replace("{org_id}", organization_id)
    headers = {
        'Authorization': tokens.getAccess(),
    }

    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #10
0
def getRecords(module):
    url = 'https://www.zohoapis.com/crm/v2/{module_id}/3490721000001172199'
    # url = 'https://www.zohoapis.com/crm/v2/{module_id}/3490721000000519039/Custom_List_History'

    url = url.replace("{module_id}", module)
    headers = {
        'Authorization': tokens.getAccess(),
        # 'If-Modified-Since': '2018-10-02T17:38:49-05:00',
        # 'If-Created-Since': '2018-10-22T17:38:49-05:00',
    }

    print('')
    print(url)
    print('')
    print(headers)
    print('')
    # Call API
    response = requests.get(url, headers=headers)
    return response
Example #11
0
__author__ = 'MinterS'

import requests
import json
from Authentication import tokens

# Define URL
url = 'https://www.zohoapis.com/crm/v2/Sales_Orders?'

# Get Token and Headers
token = tokens.getAccess()
headers = {'Authorization': token}

# Build Body
body = {
    "data": [{
        "Customer_E_mail":
        " [email protected]",
        "Customer_ID":
        "1234",
        "Job_Number":
        "12d3456",
        "Subject":
        "New Sales Order - API",
        "Customer_Name":
        "David Minter",
        "Account_Name":
        "Minter Co.",
        "Order_Date":
        "2018-09-30",
        "Due_Date":
Example #12
0
__author__ = 'MinterS'

###
# Runs API 2.0 call to return all Users from CRM.
###

import requests
import json
from Authentication import credentials, tokens
from Resources import statusCodes

# Define URL
url = 'https://www.zohoapis.com/crm/v2/users?type=ActiveUsers'
headers = {'Authorization': tokens.getAccess()}

# Call API
response = requests.get(url, headers=headers)
jsonData = json.loads(response.text)
count = jsonData['info']['count']
data = jsonData['users']

# Print Output
if response.status_code == 200:
    i = 0
    print ('')
    while i < count:
        print ('-- User ' + str(i+1) + ' --')
        print (json.dumps(data[i], sort_keys=True, indent=4))
        # print ('')
        # print ("Name: " + data[i]['full_name'])
        # print ("Email: " + data[i]['email'])