i am using c# language for accessing MailJet Api,not sure what are the parameters required as has given for cURl i am newbie , how do i get started with it , please let me know any answer would be helpful
Asked
Active
Viewed 3,894 times
-2
-
There's [an official API library](https://github.com/mailjet/mailjet-apiv3-dotnet) ([Mailjet.Api on NuGet](https://www.nuget.org/packages/Mailjet.Api/)) if you don't want to make the REST calls yourself. Or are you asking for help using that? – Rup Aug 31 '18 at 14:07
1 Answers
2
Install the nuget package: Mailjet.Api
Review the documentation at: https://github.com/mailjet/mailjet-apiv3-dotnet
There are examples of code on there.
Here's an example piece of code from Github where a client is created and resource created.
MailjetClient client = new MailjetClient(ConfigurationManager.AppSettings["apiKey"], ConfigurationManager.AppSettings["apiSecret"]);
MailjetRequest request = new MailjetRequest()
{
Resource = Contact.Resource,
}
.Property(Contact.Email, "Mister@mailjet.com");
MailjetResponse response = await client.PostAsync(request);
Console.WriteLine(string.Format("StatusCode: {0}\n", response.StatusCode));
if (response.IsSuccessStatusCode)
{
Console.WriteLine(string.Format("Total: {0}, Count: {1}\n", response.GetTotal(), response.GetCount()));
Console.WriteLine(response.GetData());
}
else
{
Console.WriteLine(string.Format("ErrorInfo: {0}\n", response.GetErrorInfo()));
Console.WriteLine(string.Format("ErrorMessage: {0}\n", response.GetErrorMessage()));
}

Ryan McDonough
- 9,732
- 3
- 55
- 76
-
Getting this result : "Id = 76, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}" , what could be the problem ? – Pradip Kondalkar Sep 03 '18 at 08:26
-
@PradipKondalkar check: https://stackoverflow.com/questions/37129427/api-request-waitingforactivation-not-yet-computed-error – Ryan McDonough Sep 03 '18 at 09:26
-
Also @PradipKondalkar if my answer has helped please mark it as Accepted. – Ryan McDonough Sep 03 '18 at 09:27