dlukic | Posts: 46

How to get Sender's ApiKey via API

0 votes
Hi, I need to get newly created sender's API key and store it in local database. Sender class does not contain attribute APIkey. Is this even possible? How? The code i'm using is below. ..... Address address = new Address(); address.Address1 = "ln 1"; address.City = "Toronto"; address.Country = "Can"; AccountMember member = AccountMemberBuilder.NewAccountMember(email) .WithFirstName("fname") .WithLastName("last name") .WithAddress(address) .WithCompany("Brokerage name from DB") .WithPhoneNumber("123 1232 2131") .WithTitle("Mr/Ms") .WithStatus(SenderStatus.ACTIVE).Build(); Sender sender = EslClient.AccountService.InviteUser(member); ..... //at this point I'd like to return sender.ApiKey

Approved Answer
harishaidary | Posts: 1812

Reply to: How to get Sender's ApiKey via API

0 votes
Right now, you can only retrieve the api key for your senders through the REST API. What you'll need to do is first retrieve the sender id of each by making a GET https://sandbox.esignlive.com/api/account/senders?from=0&to=100. Then, once you have the sender id of each, you can do a GET https://sandbox.esignlive.com/api/account/senders/{senderId}/apiKey to retrieve the api key of the current sender. Let me know if you run into any issues.

dlukic | Posts: 46

Reply to: How to get Sender's ApiKey via API

0 votes
Hi Haris, i'm getting ReasonPhrase = "Unauthorized" response. can you provide me code snippet with authorisation/authentication included. Thanks,

harishaidary | Posts: 1812

Reply to: How to get Sender's ApiKey via API

0 votes
Are you using the account owner api key? The Authorization header should be: "Basic api_key"

harishaidary | Posts: 1812

Reply to: How to get Sender's ApiKey via API

0 votes
Also make sure to use the correct base url. For example https://sandbox.esignlive.ca if you're on the Canadian instance. Also, depending if you are on version 10 (e-signlive) or 11 of esignlive (no hyphen).

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off