david.walker | Posts: 33

404 Resource Not Found error when retrieving senders with Managing Senders (REST API) sample code

0 votes

I would appreciate some help--I am trying out the sample Managing Senders (REST API) code--I just want to retrieve senders--and I'm getting {"messageKey":"http.status.404","message":"Resource Not Found","code":404,"name":"Resource Not Found"}

Here's the code I'm using;

using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace senders
{
    public class managing_senders
    {
        public static void Main(string[] args)
        {

            string apiKey = "my api key here";
            string url = "https://sandbox.esignlive.com/api";

            HttpClient myClient = new HttpClient();
            myClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", apiKey);
            myClient.DefaultRequestHeaders.Add("Accept", "application/json");

            //retrieve sender
            var response = myClient.GetAsync(new Uri(url) + "account/senders?from=0&to=10").Result;
            Debug.WriteLine(response.Content.ReadAsStringAsync().Result);

        }
    }
}

 

Thanks.


Approved Answer
Duo_Liang | Posts: 3776

Reply to: 404 Resource Not Found error when retrieving senders with Managing Senders (REST API) sample code

0 votes

Hi David,

 

For the first glance, I think you may need to add an extra slash in your URL:

            var response = myClient.GetAsync(new Uri(url) + "/account/senders?from=0&to=10").Result;
 

Duo


david.walker | Posts: 33

Reply to: 404 Resource Not Found error when retrieving senders with Managing Senders (REST API) sample code

0 votes

Thank you!


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