Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(5)  |  Derive(0)  |  Import(3)
Helper function to handle Zoho specific JSON decode.

@return: Python dictionary/list of incoming JSON data

@raise: ZohoException if JSON'ified error message is given by Zoho

        def decode_json(json_data):
    """ Helper function to handle Zoho specific JSON decode.

    @return: Python dictionary/list of incoming JSON data
    
    @raise: ZohoException if JSON'ified error message is given by Zoho
    """
    
    # {"response": {"uri":"/crm/private/json/Leads/getRecords","error": {"code":4500,"message":"Problem occured while processing the request"}}}
    data = simplejson.loads(json_data)
    
    response = data.get("response", None)
    if response:
        error = response.get("error", None)
        if error:
            raise ZohoException("Error while calling JSON Zoho api:" + str(error))
    
    return data
        


src/m/f/mfabrik.zoho-HEAD/mfabrik/zoho/crm.py   mfabrik.zoho(Download)
        raise RuntimeError("XML library not available:  no etree, no lxml")
 
from core import Connection, ZohoException, decode_json
 
class CRM(Connection):
 
        # raw data looks like {'response': {'result': {'Leads': {'row': [{'FL': [{'content': '177376000000142085', 'val': 'LEADID'}, ...
        data =  decode_json(response)
 
        return self._parse_json_response(data)
 
        # raw data looks like {'response': {'result': {'Leads': {'row': [{'FL': [{'content': '177376000000142085', 'val': 'LEADID'}, ...
        data =  decode_json(response)
 
        parsed = self._parse_json_response(data)
 
        # raw data looks like {'response': {'result': {'Leads': {'row': [{'FL': [{'content': '177376000000142085', 'val': 'LEADID'}, ...
        data =  decode_json(response)
 
        return self._parse_json_response(data)
 
        # raw data looks like {'response': {'result': {'Leads': {'row': [{'FL': [{'content': '177376000000142085', 'val': 'LEADID'}, ...
        data =  decode_json(response)
 
        return self._parse_json_response(data)

src/m/f/mfabrik.zoho-1.1/mfabrik/zoho/crm.py   mfabrik.zoho(Download)
        raise RuntimeError("XML library not available:  no etree, no lxml")
 
from core import Connection, ZohoException, decode_json
 
class CRM(Connection):
 
        # raw data looks like {'response': {'result': {'Leads': {'row': [{'FL': [{'content': '177376000000142085', 'val': 'LEADID'}, ...
        data =  decode_json(response)
 
        # Sanify output data to more Python-like format

src/m/f/mfabrik.zoho-HEAD/mfabrik/zoho/support.py   mfabrik.zoho(Download)
        raise RuntimeError("XML library not available:  no etree, no lxml")
 
from core import Connection, ZohoException, decode_json
 
class SUPPORT(Connection):