【问题标题】:How to add contact in the list using sendgrid?如何使用 sendgrid 在列表中添加联系人?
【发布时间】:2019-08-12 13:08:17
【问题描述】:

我正在尝试在列表中添加联系人,因此我使用下面的链接将单个收件人添加到列表中: click here

我有高级 100k 计划并使用完全访问 api 密钥但仍然出现禁止错误。

请帮帮我。

我的代码

string data = @"[
  {
    'age': 25, 
    'email': 'example@example.com', 
    'first_name': '', 
    'last_name': 'User'
  }, 
  {
    'age': 25, 
    'email': 'example2@example.com', 
    'first_name': 'Example', 
    'last_name': 'User'
  }
]";
        var client = new SendGridClient("#################");
        var json = JsonConvert.DeserializeObject<Object>(data);
        data = json.ToString();
        var response = await client.RequestAsync(method: SendGridClient.Method.POST, urlPath: "contactdb/recipients", requestBody: data);
        Console.WriteLine(response.StatusCode);
        Console.WriteLine(response.Body.ReadAsStringAsync().Result);
        Console.WriteLine(response.Headers.ToString());
        Console.ReadLine();
        return response;

【问题讨论】:

    标签: c# sendgrid sendgrid-api-v3


    【解决方案1】:

    您可以通过在发送网格中编辑您的 API 密钥设置并为您需要访问该 API 密钥的功能启用权限来解决此问题。

    API Keys settings

    【讨论】:

      猜你喜欢
      • 2016-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多