cancel
Showing results for 
Search instead for 
Did you mean: 
Due to an issue with YouTube, inserting videos in your emails is showing an error. Until they are able to resolve this issue, we recommend using a different video hosting service. We will continue to monitor this outage and update you as we have more information.

individual event registrant response structure different from API documentation

Occasional Contributor

individual event registrant response structure different from API documentation

I was able to successfully call the EventSpot API function to fetch info on a registrant for an event that I published, but the structure of the return data does not seem consistent with your documentation on the individual event registrant function (http://developer.constantcontact.com/docs/eventspot-apis/registrants-resource.html).

 

I customized your PHP library since you haven't added code for the EventSpot API functions yet:

 

// 'eventspot_registrant' => 'eventspot/events/%s/registrants/%s'

$baseUrl = Config::get('endpoints.base_url') . sprintf(Config::get('endpoints.eventspot_registrant'), $event_id, $registrant_id); $url = $this->buildUrl($baseUrl); $response = parent::getRestClient()->get($url, parent::getHeaders($accessToken));

 

The response I got is the following (Xs used to mark out sensitive data). I am mainly looking to fetch the promo code used by a registrant with their purchase. Is there a way to get this? And am I doing something wrong in terms of how I am calling the function? I used the following call:

 

https://api.constantcontact.com/v2/eventspot/events/{eventId}/registrants/{registrantId}?api_key=XXX...

 

array(4) {
  ["id"]=>
  string(79) "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  ["sections"]=>
  array(1) {
    [0]=>
    array(2) {
      ["label"]=>
      string(20) "Personal Information"
      ["fields"]=>
      array(3) {
        [0]=>
        array(4) {
          ["type"]=>
          string(12) "single_value"
          ["name"]=>
          string(10) "NAME_FIRST"
          ["label"]=>
          string(11) "First Name:"
          ["value"]=>
          string(10) "XXXX"
        }
        [1]=>
        array(4) {
          ["type"]=>
          string(12) "single_value"
          ["name"]=>
          string(9) "NAME_LAST"
          ["label"]=>
          string(10) "Last Name:"
          ["value"]=>
          string(9) "XXXXXXX"
        }
        [2]=>
        array(4) {
          ["type"]=>
          string(12) "single_value"
          ["name"]=>
          string(13) "EMAIL_ADDRESS"
          ["label"]=>
          string(14) "Email Address:"
          ["value"]=>
          string(27) "XXXXXXXX@XXXXXXXX.com"
        }
      }
    }
  }
  ["ticket_id"]=>
  string(9) "XXXXXXXX"
  ["registration_date"]=>
  string(24) "2014-08-20T23:35:13.975Z"
}

 

11 REPLIES 11
Occasional Contributor

Re: individual event registrant response structure different from API documentation

I also get the same return data structure (does not match http://developer.constantcontact.com/docs/eventspot-apis/registrants-resource.html) when I do a test with the same eventId and registrantId using the API test through the Constant Contact v2 API Tester/debugger (https://constantcontact.mashery.com/io-docs). :-(

Highlighted
Occasional Contributor

Re: individual event registrant response structure different from API documentation

One last thing, I am on a free trial right now as I am building an app and just wanted to test the EventSpot API functions with a published trial event. Do I need to have a paid account to get access to registrant data with the API?

Occasional Contributor

Re: individual event registrant response structure different from API documentation

I just discovered that the data on the promo code used with a purchase is only given by the API if the purchase total is above $0. My first test I used a $10 off promo code that brought a $10 ticket down to $0 -- no promo code data was given by the API call for this even registrant. I just tried again with a $2 ticket that has a $1 promo code applied to it bringing the total for the purchase to $1 -- the API produced data on the promo code used.

For the app that I am building, there is a chance that customers may use a promo code that would bring their order total to $0, but for these purchases we would still like to know which promo code was used. Could the API maybe be updated to produce this data with the Individual Event Registrant Endpoint?

Honored Contributor

Re: individual event registrant response structure different from API documentation

Hello,

 

After reviewing your results, I will be doing some testing today and tomorrow to verify what is happening with the Promo Codes and I will follow up with some results and give you some info on what to expect.

 

Regarding the limitations of a trial, the trial status of your account does not impose any limitations on what the API will allow you to do. The only limitations are those set on the product, but the API will function the same in a paid and trial account.

 

If you do see anything else unusual, please let me know and I will look into that as well.

 

Best Regards,

Elijah G.
API Support Engineer
Occasional Contributor

Re: individual event registrant response structure different from API documentation

Thank you for looking in to the issue with the registrant purchase data. Wondering if you were able to reproduce the same issue with data not being returned on the payment_summary for orders that are reduced to $0 by a promo/coupon code?

Honored Contributor

Re: individual event registrant response structure different from API documentation

Hello,

 

My apologies for not getting back to you sooner! I was able to reproduce this using the V2 API and confirmed that right now the promo code is not showing for registrants who have reduced their price to $0. Right now we have a dev from the EventSpot team checking into this so that we can verify if it is an issue in the external API or if there is some information missing when it is being passed to the API. Once we know a bit more about the cause, I should be able to give some information on what is expected.

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Contributor

Re: individual event registrant response structure different from API documentation

Thank you for the update Elijah!

Honored Contributor

Re: individual event registrant response structure different from API documentation

Hello,

 

It has been a while and I am late on the notification, but I wanted to let you know that this issue was corrected at the end of October. You should no longer have an issue with the promo code information not being displayed for registrants who did not pay a fee.

 

If you see any further issues, please let us know!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Participant

Re: individual event registrant response structure different from API documentation

Can you share what you did to customize the library to collect eventspot entries? I, too, modified the config with:

 

 'eventspot_registrant' => 'eventspot/events/%s/registrants/%s'

 

I also created a function in ListService.php to retrieve the contacts:

 

   /**
     * Get all contacts from an event list
     * @param string $accessToken - Constant Contact OAuth2 access token
     * @param string $eventId - event id for which to retrieve contacts
     * @return ResultSet
     */
    public function getRegistrantsFromEvent($accessToken, $eventId)
    {
        echo $baseUrl = Config::get('endpoints.base_url') . sprintf(Config::get('endpoints.eventspot_registrant'), $eventId);
        $url = $this->buildUrl($baseUrl, $params);

        $response = parent::getRestClient()->get($url, parent::getHeaders($accessToken));
        $body = json_decode($response->body, true);
        $registrants = array();
        foreach ($body['results'] as $registrant) {
            $registrants[] = Contact::create($registrant);
        }
        return new ResultSet($registrants, $body['meta']);
    }

 

However, this succeeds in retrieving nothing. What am I missing? Many thanks.