0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Bench mark mail API で外部のメールフォームから顧客情報を登録する

Posted at

BenchMark mail?

BenchMark mailとは、メールフォームを簡単に作成し、顧客管理などを行うことができるサービスのこと。

API Document

今回やったこと

・外部のメールフォームから必要情報を取得し、APIでBenchMarkに送信
・事前に作成した顧客リストにユーザー情報を追加

手順

1.BenchMarkに登録

2.マイメニューからAPIKeyを取得

右上の自分のアイコンをクリック
→API連携
→APIキー

3.以下サンプルコードにならって作成

1.{{url}}は

https://clientapi.benchmarkemail.com/Contact/{{ListId}}/ContactDetails
var data = {"Data":{
"Email":"{{email}}",
"FirstName":"{{FirstName}}",
"LastName":"{{LastName}}",
"EmailPerm":"{{0 or 1}}",
"Field1": "{{NickName}}",
"Field2": "{{custumField}}",
"Field3": "{{custumField}}",
"Field4": "{{custumField}}",
"Field5": "{{custumField}}",
"Field6": "{{custumField}}",
"Field7": "{{custumField}}",
"Field8": "{{custumField}}",
"Field9": "{{custumField}}"
};

var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.open( 'POST', '{{url}}' );

xmlHttpRequest.setRequestHeader( 'Content-Type', 'application/json' );
xmlHttpRequest.setRequestHeader( 'AuthToken', '{{token}}' );

xmlHttpRequest.send(data);

xmlHttpRequest.addEventListener("load", function(){
	console.log(this.response); // 通信結果出力
}, false);

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?