Currently, we allow sending data to Factors via an API using the same endpoints used to collect data from Segment. Hence, to send data to Factors via API:

  1. Enable Segment Integration on Integration Screen:

  2. Note down the Segment API key. Example wlmg8vgvldkx0s8noreidtxjnrt72muq

  3. Add a colon at the end of the API key. wlmg8vgvldkx0s8noreidtxjnrt72muq:

  4. Convert it into base 64 encoding using this online tool. https://www.base64encode.org/ d2xtZzh2Z3ZsZGt4MHM4bm9yZWlkdHhqbnJ0NzJtdXE6

  5. Every API request from a customer will need the Authorization Header as follows. Authorization: Basic d2xtZzh2Z3ZsZGt4MHM4bm9yZWlkdHhqbnJ0NzJtdXE6

Customers can now send events data to Factors by making POST requests to https://api.factors.ai/integrations/segment endpoint along with the Authorization Header.

The requests we support are elaborated here, https://segment.com/docs/connections/destinations/catalog/webhooks/.

More details on the data model can be found here.

https://segment.com/docs/connections/spec/common/

The two supported requests are below:

1.) Track request - To track a custom event with properties.

{

"type" : "track",

"anonymousId": "507f191e810c19729de860ea",

"userId" : "019mr8mf4r",

"event" : "Purchased an Item",

"properties" : {

"revenue" : "39.95",

"shippingMethod" : "2-day"

},

"timestamp" : "2012-12-02T00:30:08.276Z"

}

2.) Identify request - To identify a user with a known user id and to add user / profile properties. (Use case is to stitch user journeys from multiple sources by using a known id)

{

"version" : 1,

"type" : "identify",

"anonymousId": "507f191e810c19729de860ea",

"userId" : "achilles@segment.com",

"traits" : {

"name" : "Achilles",

"subscriptionPlan" : "Premium",

"friendCount" : 29

},

"timestamp" : "2012-12-02T00:30:08.276Z"

}

Note that:

  1. Every request should have an anonymous id.

  2. Every request for an identified user can further have an optional user_id (like email or internal user id). If the user is not identified and a track call has this field set, we will internally mark the user as identified with the given user_id.

Did this answer your question?