投稿API
フィードバック投稿をプログラムで作成・取得します。
投稿一覧
GET /api/v2/submissions
クエリパラメーター
| パラメーター | 型 | 説明 |
|---|---|---|
page | integer | ページ番号(デフォルト:1) |
per_page | integer | 1ページあたりのアイテム数(デフォルト:15、最大:100) |
status | string | ステータスでフィルタ:pending、approved、resolved、spam |
campaign_id | integer | キャンペーンIDでフィルタ |
product_id | integer | 製品IDでフィルタ |
from | date | 開始日(YYYY-MM-DD) |
to | date | 終了日(YYYY-MM-DD) |
例
curl "https://yourdomain.com/api/v2/submissions?status=approved&per_page=10" \
-H "Authorization: Bearer YOUR_API_KEY"
レスポンス
{
"data": [
{
"id": 42,
"campaign_id": 1,
"product_id": 1,
"star_rating": 5,
"nps_score": 9,
"text_feedback": "Absolutely love this product!",
"customer_name": "Jane Doe",
"customer_email": "[email protected]",
"sentiment_score": 0.92,
"sentiment_label": "positive",
"status": "approved",
"is_public": true,
"admin_reply": "Thank you, Jane! We're glad you love it.",
"created_at": "2024-03-15T10:30:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 10,
"total": 42
}
}
単一投稿の取得
GET /api/v2/submissions/{id}
例
curl "https://yourdomain.com/api/v2/submissions/42" \
-H "Authorization: Bearer YOUR_API_KEY"
投稿の作成
POST /api/v2/submissions
リクエストボディ
{
"campaign_id": 1,
"star_rating": 5,
"nps_score": 9,
"text_feedback": "Great product, very intuitive!",
"customer_name": "John Smith",
"customer_email": "[email protected]"
}
パラメーター
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
campaign_id | integer | はい | 投稿先のキャンペーン |
star_rating | integer | いいえ | 1〜5の星評価 |
nps_score | integer | いいえ | 0〜10のNPSスコア |
text_feedback | string | いいえ | 自由記述フィードバック |
customer_name | string | いいえ | 投稿者名 |
customer_email | string | いいえ | 投稿者のメールアドレス |
survey_responses | object | いいえ | カスタムサーベイフィールドの回答 |
レスポンス(201 Created)
{
"data": {
"id": 43,
"campaign_id": 1,
"star_rating": 5,
"status": "pending",
"created_at": "2024-03-15T11:00:00Z"
},
"message": "Submission created successfully"
}