how to integrate Member Signup webhook in .net application

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: EOL CLEANUP

how may i integrate Member Signup webhook in .net MVC application
Photo of 00022493 - Point Blank

00022493 - Point Blank

  • 5 Posts
  • 0 Reply Likes

Posted 11 months ago

  • 0
  • 1
Photo of Ross Cochran

Ross Cochran, Official Rep

  • 134 Posts
  • 10 Reply Likes
Hi there! 

We have some wrappers that are built to help speed up your API implementation. We do have one made for .net and you can find that here:
http://api.myemma.com/#api-wrappers

I do also want to point out that our API is self service, and the documentation on that page will be your best bet in getting up and running. 

Cheers!
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
Hi,

To add to what Ross said, feel free to check out the API wrappers. Another item that may help you is the ASP.NET WebHooks project. There are samples on how to setup a custom webhooks receiver as well as some of their out-of-box vendors that the project supports that could get you started. The project is Full framework, but looks like there is some progress on ASP.NET Core versions.

Hope that helps get you started.

Thanks,
Kyle
Photo of 00022493 - Point Blank

00022493 - Point Blank

  • 5 Posts
  • 0 Reply Likes
https://api.e2ma.net/123/members?start=0&end=500   how to  implement in ASP.net APP
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
Hi there,

I maintain the EmmaSharp wrapper for .NET. Unless you are running a Core application, you can use the wrapper to help with your Emma API calls. Per the documentation, it's best to call a count to get your number of records, then call your main endpoint and iterate over the records until you have retrieved them all. Here's some pseudo-code to get you started:
using EmmaSharp;

var emmaMemberCount = new EmmaApi("publicKey", "privateKey", "accountId");
var getMemberCount = emmaMemberCount.GetMemberCount(true); //Get all members, including deleted
var page = (int)Math.Floor(getMemberCount / 500.0);
List<Member> members = new List<Member>();

for (int i = 0; i < page; i++)
{
    var start = i * 500;
    var end = ((i + 1) * 500) > getMemberCount ? getMemberCount : (i + 1) * 500;
    var emmaMemberList = new EmmaApi("publicKey", "privateKey", "accountId");
    var getMembers = emmaMemberList.ListMembers(true, start, end);
    members.AddRange(getMembers);
}

return members;
Hope that helps,
Kyle
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
Hi,

It looks like in the code above you're mixing API calls with Webhook callbacks. Interacting with the API can allow you to create, update and delete webhook definitions (like updating the URL where to send the POST notifications). However consuming the webhook responses will need to be handled by different code, which is not something the EmmaSharp library will do.

Determining how you will consume the webhook responses will be up to your design for your application. You can use the ASP.NET Webhooks library, another library or you can write your own code, depending on your needs.  ASP.NET Webhooks project samples can show you how that's set up on some other services, and maybe help you get started.

Hope that helps point you in the right direction. 

Thanks,
Kyle
Photo of 00022493 - Point Blank

00022493 - Point Blank

  • 5 Posts
  • 0 Reply Likes
CAN u send me the implementation of
 GET /#account_id/webhooks

{
        "event_name": "member_signup",
        "data": {
            "account_id": account_id,
            "member_id": member_id,
            "mailing_id": mailing_id
            } 
}

this webhook??????    in .net
(Edited)
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
Hi there,

Sorry, I don't have anything to help with your implementation on receiving Webhooks. That will be up to how you want to handle receiving the data within your application. 

GET /#account_id/webhooks - Is an API call to work with the Emma platform.
{"event_name": "member_signup", ... - Is the POSTed data to YOUR application endpoint. This is sent to your application after a specific event.

These concepts are separate.

Thanks,
Kyle
Photo of 00022493 - Point Blank

00022493 - Point Blank

  • 5 Posts
  • 0 Reply Likes
subscription information will show in AUDIENCE tab same as if i have webhook information, in admin site where it will show?
Photo of Kyle Gregory | Lipscomb University

Kyle Gregory | Lipscomb University, Champion

  • 99 Posts
  • 69 Reply Likes
I believe registered webhooks can only be queried from the API. To my knowledge there is no place in the application to view or update them.

Thanks,
Kyle
Photo of Ross Cochran

Ross Cochran, Official Rep

  • 134 Posts
  • 10 Reply Likes
Hi there!

I wanted to post an update, and Emma user Sean has written a guide on how to create a webhook listener with .Net you can find his write up here:

http://seanstech.life/index.php/2018/07/11/custom-webhooks-in-net-with-emma-api-easily-test-with-pos...

Cheers!