Skip to main content

Manage Counter

Overview​

The Manage Counter API allows users to cap the number of registrations for each event, ensuring that the event does not exceed its registration limit. Additionally, it provides the ability to display a dynamic message on the landing page (via Ajax) when the registration limit is reached.

Manage Counter Service

Setup Instructions​

Step 1 — Access the Service​

Click on Manage Service, then click the "+" button to create a new Manage Counter service.

Create Manage Counter

Step 2 — Enter Event Details​

Enter Event Details

Provide the following information:

FieldDescriptionExample
Event NameName of the eventDemoGiveAway
Current CountStarting point for the registration count23
Maximum CountMaximum number of registrations allowed30
Message When Maximum Count ReachesMessage displayed once the limit is reachedNo more seats are available

Step 3 — Enable Ajax Request​

Ajax Details

Check the Allow Ajax Request checkbox to enable dynamic interactions on the landing page (such as showing a message when the registration limit is met).

Step 4 — Domain Whitelisting and WebKey​

If using the API within an Ajax call:

  • Whitelist the domains that will make Ajax requests — ensures only authorized domains can access the API.
  • Include a WebKey in your Ajax call for proper authentication.

Step 5 — Save and Activate​

After entering the details, click Save.

Save Message

Then Activate the service to start using the API.


API Details​

Query Parameters​

Query Parameters
ParameterDescription
eventThe name of the event (e.g., DemoGiveAway)
numThe current count of registrations
actThe action to execute — can have one of four possible values (e.g., check or increment)

Webhook URL Example:

https://api.rw001.com/rdn/api/adv/manageCounter?event={Marketo token for event}&act={Marketo token for act}&num={Marketo token for num}

Output JSON:

{"message": "<message value>"}

The message corresponds to the event's registration status (e.g., "Registration full" or "Registration is still open").


Step 6 — Test the Service​

Click the "Show Live Testcase" button to test the configuration.

Test Service - Step 1

Enter the Event Name you previously configured, then click Get Result to see the API response.

Test Service - Result

Ajax Integration (Optional)​

To dynamically update your landing page based on the registration count, integrate the Manage Counter API into an Ajax call:

$.ajax({
url: 'https://api.rw001.com/rdn/api/adv/manageCounter',
method: 'GET',
data: {
event: 'DemoGiveAway', // Event Name
num: 23, // Current Count
act: 'check' // Action: Check the current count
},
success: function(response) {
if (response.message === "Registration Full") {
$('#registrationForm').hide();
$('#eventFullMessage').show();
}
}
});

This allows the landing page to update in real time — hiding the registration form and displaying a message when the event is full.


Configuring in Marketo​

Service Name: Manage Counter
Service Type: Advanced Service

info

The request parameter values and Marketo Fields shown are examples. Enter values based on your specific service requirement.

Step 1 — Create a New Webhook​

Go to Admin → Webhooks and click New Webhook.

Step 2 — Configure the Webhook​

FieldValue
Webhook NameManage Counter (or as per requirement)
URLhttps://api.rw001.com/rdn/api/adv/manageCounter?event={token}&act={token}&num={token}
TemplateLeave blank
Request Token EncodingNone (POST) / uneditable (GET)
Response TypeJSON
Request TypeGET

Step 3 — Add Authentication Header​

caution

Use the exact same auth-key and Content-Type values when configuring the webhook.

Step 4 — Response Mappings​

Map the message response attribute to the appropriate Marketo field.


Use Cases​

  • Event Registration Limitations: Ensure the event does not exceed the maximum number of attendees.
  • Real-time User Feedback: Display a message on the landing page or form when the event reaches its registration limit.
  • Efficient Event Management: Control and streamline the registration process for large-scale events.