404 Resource Not Found error when retrieving senders with Managing Senders (REST API) sample code
Monday, December 13, 2021 at 11:02amI 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.
Reply to: 404 Resource Not Found error when retrieving senders with Managing Senders (REST API) sample code
Monday, December 13, 2021 at 11:12amHi 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
Reply to: 404 Resource Not Found error when retrieving senders with Managing Senders (REST API) sample code
Monday, December 13, 2021 at 11:21amThank you!