Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  From API to CLI: Making Genesys Cloud Commands Easier to Read

    Posted 5 hours ago

    If you've spent time working with Genesys Cloud APIs, you already understand more about the CLI than you might think.

    I used to look at CLI commands and feel like they belonged in a different world. But once I started mapping them back to REST APIs, it clicked: it's the same conversation with the platform, just written differently.

    So here's a simple way to think about it.

    The REST API structure (the one most of us know):
    METHOD /url-endpoint?query=params&expand=...

    Example:
    GET /api/v2/users?pageSize=25&expand=presence

    In plain terms:
    "Get me a list of users, limit it to 25, and include their presence information."

    Now let's look at the CLI version of that same request.

    The CLI structure:
    gc <resource> <command> --flag value

    Example:
    gc users list --pageSize 25 --expand presence

    Same request. Same outcome. Just a different way of asking.

    Here's how the pieces map:

    • METHOD (GET, POST, PUT, DELETE) → becomes the command (list, create, update, delete)

    • Endpoint (/api/v2/users) → becomes the resource (users)

    • Query params (?pageSize=25&expand=presence) → become flags (--pageSize 25 --expand presence)

    Once you see this, the CLI stops feeling new. It's just a more direct way to work with the API.

    A few flags you'll see all the time:

    • --expand
      Ask for additional related data. Instead of making multiple calls, you bring more context into one response.

    • --pageSize
      Control how many results come back. Useful when you're testing or trying to limit output.

    • --pageNumber
      Move through paginated results. Same idea as API pagination, just cleaner to type.

    • --id
      Target a specific object. Instead of filtering a list, you go straight to what you need.

    • --name
      Often used when creating or filtering resources in a more human-readable way.

    • --file
      Pass a JSON payload from a file. This is especially useful for create/update operations where typing everything inline would be painful.

    The more you work with both, the more you realize:

    The API asks through HTTP.
    The CLI asks through commands.
    But both are asking Genesys Cloud to do the exact same thing.

    And sometimes, the CLI is just the faster way to say it. 

    If you want to learn more about APIs in Genesys Cloud, do not forget to checkout the resources available at Genesys Education, specially our Workshop on Genesys CLI.

    Curious to hear from others: do you tend to reach for APIs or the CLI first when working in Genesys Cloud - and why?


    #PlatformAPI
    #PlatformCLI

    ------------------------------
    Rodrigo Soares
    NALA Team Lead
    ------------------------------


  • 2.  RE: From API to CLI: Making Genesys Cloud Commands Easier to Read

    Posted 2 hours ago

    This is a very good point, some things are simpler to say with CLI. A customer mentoned creating SCIM users as an example of what they prefered to do using CLI.



    ------------------------------
    Mario Reina de Califfa Jr.
    Core Instructor
    ------------------------------