The 6sense Real-Time Scoring API provides real-time scoring and enrichment capabilities for your Smart Campaigns within Marketo using webhooks.
API documentation
Refer to the separate endpoints we provide for the following APIs in our API Documentation:
Generate an API token
An Administrator or operations user can generate a new API token within 6sense.
- Go to Settings > Integrations > All Integrations > API Token. 
- You should see a table below API Credits. This should have Enrichment APIs as a Credits Type. Make sure that there are credits available next to Enrichment APIs. 
- Select Generate New API Token. 
- Fill out the following fields: API Group Name, Token Name, and Integrations. 

- Select Lead Scoring API as the API Group Name. We recommend being descriptive yet concise with the Token Name (for example, Lead Scoring & Enrichment). 
- After selecting Marketo as the Integration, select Generate. 

Set up the webhook
- Log in to Marketo and select Admin. 
- Select Webhooks under Integration.  
- Select New Webhook and configure your webhook as follows:  
Template:
title={{lead.Job Title}}&
country={{lead.Country:default=USA}}&
email={{lead.Email Address}}&
website={{lead.Website}}&
company={{lead.Company Name}}&
leadsource={{lead.Lead Source}}&
firstname={{lead.First Name}}&
lastname={{lead.Last Name}}&
role={{lead.Role}}&
industry={{lead.Industry}}- Click on Webhook Actions -> Set Custom Header   
- Input your API token. If your token is “abcdefg123”, you should input “Token abcdefg123” as your Value. Including a space between “Token” and your API key will be important. 
Confirm the customer header is spelled correctly = Authorization.
Edit your Response Mapping

Enrichment fields
6sense provides many fields for enrichment. Please see the response data available in our API documentation.
6sense scores
6sense provides the following scores, each of which should be mapped to a Marketo field for each of your products:
- Company Intent Score => scores[0].company_intent_score 
- Company Buying Stage => scores[0].company_buying_stage 
- Company Profile Score => scores[0].company_profile_score 
- Company Profile Fit => scores[0].company_profile_fit 
- Contact Intent Score => scores[0].contact_intent_score 
- Contact Grade aka => scores[0].contact_grade 
- Contact Profile Score => scores[0].contact_profile_score 
- Contact Profile Fit => scores[0].contact_profile_fit 
If you only have one product, then you will only need 8 Marketo fields to store each of these scores. For every additional Product you have, you will need 8 additional fields to store the respective scores for those Products.
In the programming world, you count things starting from 0. In the example below, the first product “Wireless LAN” under the scores section would be scores[0]. The second product “SD-WAN” would be scores[1]. If you had a third product, it would be scores[2] and so forth.
The number of elements in the “scores” array will vary depending on how many Products have been configured for your organization.
Include a webhook in a Smart Campaign workflow
You can include this webhook as part of a Smart Campaign workflow. 
- Choose the triggers that make sense for your marketing workflow. 
- Verify the request and response of the webhook.  
- Navigate to your Campaign Results > Click on the ID to see the Activity Log for that Lead > Click on the response to verify that you have a Response Code: 200 (success!) 
The API will return results once the Predictive models are live.