Support
Add a message as an end user
Add a message to a support request, verifying the ticket belongs to the external user
Add a message as an end user
Add a message to a support request, verifying the ticket belongs to the external user
POST https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}
curl --request POST \
--url 'https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"content": "string",
"help_article_ids": [
"string"
]
}'
Authentication: x-api-key (header)
201: Created
400: Bad Request
401: Unauthorized
403: Forbidden
404: Not Found
500: Internal Server ErrorAuthorizations
x-api-key (header)requiredRequest examples show the credential location. Use a server-side key with the permissions required by this operation.
Path parameters
idstringpathrequiredexternalUserIdstringpathrequiredBody
application/jsonattachmentsarraycontentstringrequiredhelp_article_idsarrayResponses
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error
curl --request POST \
--url 'https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"content": "string",
"help_article_ids": [
"string"
]
}'const response = await fetch("https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}", {
method: "POST",
headers: {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
},
body: "{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}",
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());
import requests
response = requests.request(
"POST",
"https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}",
headers={"x-api-key": "<api-key>", "Content-Type": "application/json"},
data="{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}".encode("utf-8"),
timeout=30,
)
response.raise_for_status()
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.appgram.dev/api/v1/support-requests/%7Bid%7D/messages/user/%7BexternalUserId%7D"
payload := strings.NewReader("{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import Foundation
var request = URLRequest(url: URL(string: "https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}")!)
request.httpMethod = "POST"
request.setValue("<api-key>", forHTTPHeaderField: "x-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = Data("{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}".utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
// Requires OkHttp 4.x.
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val request = Request.Builder()
.url("https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}")
.method("POST", "{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}".toRequestBody("application/json".toMediaType()))
.addHeader("x-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
OkHttpClient().newCall(request).execute().use { response ->
println(response.body?.string())
}
}
// Requires package:http in pubspec.yaml.
import 'package:http/http.dart' as http;
Future<void> main() async {
final request = http.Request("POST", Uri.parse("https://api.appgram.dev/api/v1/support-requests/{id}/messages/user/{externalUserId}"));
request.headers.addAll({
"x-api-key": "<api-key>",
"Content-Type": "application/json",
});
request.body = "{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}";
final response = await request.send();
print(await response.stream.bytesToString());
}
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.appgram.dev/api/v1/support-requests/%7Bid%7D/messages/user/%7BexternalUserId%7D"),
Headers =
{
{ "x-api-key", "<api-key>" },
},
Content = new StringContent("{\n \"attachments\": [\n {\n \"mime_type\": \"string\",\n \"name\": \"string\",\n \"size\": 0,\n \"url\": \"string\"\n }\n ],\n \"content\": \"string\",\n \"help_article_ids\": [\n \"string\"\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}{
"data": {
"attachments": [
{
"mime_type": "string",
"name": "string",
"size": 0,
"url": "string"
}
],
"author": {
"avatar_url": "string",
"id": "string"
},
"author_name": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"help_articles": [
{
"article_type": "faq",
"author": {},
"author_user_id": "string",
"content": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"excerpt": "string",
"flow": {},
"flow_id": "string",
"id": "string",
"is_published": true,
"locale": "string",
"published_at": "1970-01-01T00:00:00.000Z",
"seo_description": "string",
"seo_noindex": true,
"seo_og_image_url": "string",
"seo_title": "string",
"slug": "string",
"sort_order": 0,
"tags": [],
"title": "string",
"translation_group_id": "string",
"translations": [],
"updated_at": "1970-01-01T00:00:00.000Z",
"url": "string"
}
],
"id": "string",
"is_from_user": true,
"support_request_id": "string",
"updated_at": "1970-01-01T00:00:00.000Z"
},
"success": true
}