Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  to get cursor in python SDK for get_analytics_conversations_details_job_results API

    Posted 04-16-2025 17:07

    Hi Team.

    I create a program in Python for get the resul for JOB converstion details, the API :

    get_analytics_conversations_details_job_results(job_id, cursor=cursor1, page_size=page_size)
    In the end cursor is:
     'cursor': None,
    This indicate that there are more cursor o data.
    And my Python code is:
    result_cursor = f""
    pprint(result_cursor)
    print(f"\n")

    result_coversationTotal = []
    i = 1

    while True:
        pprint(f"El valor del cursor actual es 1 {result_cursor}")
        result_coversation = api_analitycs.get_analytics_conversations_details_job_results(job_id, cursor=result_cursor,page_size=page_size).conversations
        result_coversationTotal = result_coversationTotal + result_coversation
        pprint(np.shape(result_coversationTotal))

        result_cursoractual = api_analitycs.get_analytics_conversations_details_job_results(job_id, cursor=result_cursor,page_size=page_size).cursor
        pprint(f"El valor del cursor actual es {result_cursoractual}")
        print(f"\n")
        i = i + 1
        pprint(f"próxima eteración es {i}")

        if result_cursoractual == "None":
            pprint(f"Entró al IF")
            print_and_log("La recuperacion del JOB está completa, podemos proceder a obtener los conversationID")
            break
       
        elif result_cursoractual != "None":
            result_cursor = result_cursoractual
            pprint(f"Entró al ELIF")
            pprint(f"El valor del nuevo cursor API es {result_cursor}")
            print(f"\n")
    But the IF is not working. Never enters the IF condition. I want to known the cause. Please, can you help me?

    #PlatformAPI
    #PlatformSDK

    ------------------------------
    Edward Enrique Herrera
    Chief Support Leader
    ------------------------------


  • 2.  RE: to get cursor in python SDK for get_analytics_conversations_details_job_results API
    Best Answer

    Posted 04-18-2025 10:35

    Hello,

    None is a keyword in Python. It is used to define a null value.

    Please try with `if result_cursoractual == None:` (no quotes around None).

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 3.  RE: to get cursor in python SDK for get_analytics_conversations_details_job_results API

    Posted 04-21-2025 15:03

    Thank you!



    ------------------------------
    Edward Enrique Herrera
    Chief Support Leader
    ------------------------------