Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Teams
, (opens new window)

Segment CLI
  • Reference
    Reference
     This trigger is hidden
  • User's Guide
    User's Guide
     This trigger is hidden
  • Administrator's Guide
    Administrator's Guide
     This trigger is hidden
  • Administrator's Guide
    Administrator's Guide
     This trigger is hidden
  • Release notes
    Release notes
     This trigger is hidden
  • Share data with the Support team
    Share data with the Support team
     This trigger is hidden
  • Downloads
    Downloads
     This trigger is hidden
Results will update as you type.
  • User's Guide
    • Reference
    • Advanced topics
    • Examples
  • Administrator's Guide
    Calendars
You‘re viewing this with anonymous access, so some content might be blocked.
/
Examples
Updated Aug 19





Examples

Action usage examples

Examples give users ideas on actual usage. We use automation to generate, test, and run these actions, so names and combinations may be odd or repetitive . In many cases, other actions or environmental setup is required for the action to run, so you will need to adjust the action parameters and setup appropriate for your environment. 

Command line environments can be different, especially between Windows and non-Windows systems. This page talks about command line escaping differences and there are differences with respect to environment variable references ($ for non-Windows and %...% for Windows). These differences can impact examples, so recognize and adjust for your platform. In particular, all examples here are run with the standard bash shell on Linux.



getClientInfo

--action getClientInfo

identifyUser

--action identifyUser --token "***" --userId "cli_1@appfire.com" --afterSql "insert into test01 (a1) values('segment')" --database "@database-test" --properties "{\"email\":\"cli_1@appfire.com\", \"organization\":\"appfire\"}" --properties2 "{\"region\":\"Americas\", \"empty\":null, \"organization\":\"appfire\"}"

--action identifyUser --token "***" --userId "cli_1@appfire.com" --properties "{\"email\":\"cli_1@appfire.com\", \"organization\":\"appfire\"}" --properties2 "{\"region\":\"Americas\", \"empty\":null, \"organization\":\"appfire\"}"

--action identifyUser --token "***" --userId "cli_1@appfire.com" --sendNullProperties --properties "{\"email\":\"cli_1@appfire.com\", \"organization\":\"appfire\"}" --properties2 "{\"region\":\"Americas\", \"empty\":null, \"organization\":\"appfire\"}"

runFromList

--action runFromList --list "userId" --token "***" --common "-a identifyUser --userId @entry@"

trackEvent

--action trackEvent --token "***" --userId "cli_1@appfire.com" --event "My event" --properties "{\"email\":\"cli_1@appfire.com\", \"organization\":\"appfire\"}" --properties2 "{\"region\":\"Americas\", \"empty\":null, \"organization\":\"appfire\"}"

Unable to render {include} The included page could not be found.
Unable to render {include} The included page could not be found.
{"serverDuration": 13, "requestCorrelationId": "20b247cd591a4a7991ebfbf0b2470a99"}