Appearance
User - Notes
Base URL:
https://your-domain.com
Admin endpoints for managing notes attached to subscribers or users. All endpoints require admin/staff authentication.
Fetch All Notes
Retrieve all notes.
| Property | Value |
|---|---|
| Endpoint | Fetch All Notes |
| Method | GET |
| URL | /api/v1/notes |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Success Response (200 OK):
json
{
"success": true,
"data": [
{
"id": 1,
"title": "Connection Issue",
"to_profile_type": 2,
"to_username": "subscriber1",
"created_by": "Admin",
"created_at": "2024-01-15 10:30:00"
}
]
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/notes" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$response = $client->request('GET', '/api/v1/notes', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const response = await fetch(`${BASE_URL}/api/v1/notes`, {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
response = requests.get(
f"{BASE_URL}/api/v1/notes",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
endpoint := baseURL + "/api/v1/notes"
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.get(format!("{BASE_URL}/api/v1/notes"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Fetch Note
Retrieve details of a specific note.
| Property | Value |
|---|---|
| Endpoint | Fetch Note |
| Method | GET |
| URL | /api/v1/notes/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"data": {
"id": 1,
"title": "Connection Issue",
"content": "Customer reported slow speeds",
"to_profile_type": 2,
"to_id": 1,
"to_username": "subscriber1",
"created_by": "Admin",
"created_at": "2024-01-15 10:30:00"
}
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/notes/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$noteId = 1;
$response = $client->request('GET', "/api/v1/notes/{$noteId}", [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const noteId = 1;
const response = await fetch(`${BASE_URL}/api/v1/notes/${noteId}`, {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
note_id = 1
response = requests.get(
f"{BASE_URL}/api/v1/notes/{note_id}",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
"strconv"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
noteId := 1
endpoint := baseURL + "/api/v1/notes/" + strconv.Itoa(noteId)
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let note_id = 1;
let response = client
.get(format!("{BASE_URL}/api/v1/notes/{note_id}"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Create Note
Create a new note for a subscriber or user.
| Property | Value |
|---|---|
| Endpoint | Create Note |
| Method | POST |
| URL | /api/v1/notes |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"title": "Note Title",
"content": "Note content here",
"to_profile_type": 2,
"to_id": 1,
"to_username": "subscriber1"
}| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Note title |
content | string | No | Note content |
to_profile_type | integer | Yes | 1=User, 2=Subscriber |
to_id | integer | Yes | Target entity ID |
Success Response (201 Created):
json
{
"success": true,
"message": "Note created successfully",
"data": {
"id": 1
}
}Code Examples:
bash
curl -X POST "https://your-domain.com/api/v1/notes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"title": "Note Title",
"content": "Note content here",
"to_profile_type": 2,
"to_id": 1,
"to_username": "subscriber1"
}'php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$response = $client->request('POST', '/api/v1/notes', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'json' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
'title' => 'Note Title',
'content' => 'Note content here',
'to_profile_type' => 2,
'to_id' => 1,
'to_username' => 'subscriber1',
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const response = await fetch(`${BASE_URL}/api/v1/notes`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
body: JSON.stringify({
isp_id: 1,
branch_id: 1,
user_id: 1,
title: 'Note Title',
content: 'Note content here',
to_profile_type: 2,
to_id: 1,
to_username: 'subscriber1',
}),
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
response = requests.post(
f"{BASE_URL}/api/v1/notes",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
json={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"title": "Note Title",
"content": "Note content here",
"to_profile_type": 2,
"to_id": 1,
"to_username": "subscriber1",
},
)
data = response.json()
print(data)go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
endpoint := baseURL + "/api/v1/notes"
payload, _ := json.Marshal(map[string]any{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"title": "Note Title",
"content": "Note content here",
"to_profile_type": 2,
"to_id": 1,
"to_username": "subscriber1",
})
req, _ := http.NewRequest("POST", endpoint, bytes.NewBuffer(payload))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
use serde_json::json;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.post(format!("{BASE_URL}/api/v1/notes"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.json(&json!({
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"title": "Note Title",
"content": "Note content here",
"to_profile_type": 2,
"to_id": 1,
"to_username": "subscriber1"
}))
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Update Note
Update an existing note.
| Property | Value |
|---|---|
| Endpoint | Update Note |
| Method | PUT |
| URL | /api/v1/notes/{id} |
| Authentication | Bearer Token |
Request Body:
json
{
"title": "Updated Note",
"content": "Updated content"
}Success Response (200 OK):
json
{
"success": true,
"message": "Note updated successfully"
}Code Examples:
bash
curl -X PUT "https://your-domain.com/api/v1/notes/1" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"title": "Updated Note",
"content": "Updated content"
}'php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$noteId = 1;
$response = $client->request('PUT', "/api/v1/notes/{$noteId}", [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'json' => [
'title' => 'Updated Note',
'content' => 'Updated content',
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const noteId = 1;
const response = await fetch(`${BASE_URL}/api/v1/notes/${noteId}`, {
method: 'PUT',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
body: JSON.stringify({
title: 'Updated Note',
content: 'Updated content',
}),
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
note_id = 1
response = requests.put(
f"{BASE_URL}/api/v1/notes/{note_id}",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
json={
"title": "Updated Note",
"content": "Updated content",
},
)
data = response.json()
print(data)go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"strconv"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
noteId := 1
endpoint := baseURL + "/api/v1/notes/" + strconv.Itoa(noteId)
payload, _ := json.Marshal(map[string]any{
"title": "Updated Note",
"content": "Updated content",
})
req, _ := http.NewRequest("PUT", endpoint, bytes.NewBuffer(payload))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
use serde_json::json;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let note_id = 1;
let response = client
.put(format!("{BASE_URL}/api/v1/notes/{note_id}"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.json(&json!({
"title": "Updated Note",
"content": "Updated content"
}))
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Delete Note
Delete a note.
| Property | Value |
|---|---|
| Endpoint | Delete Note |
| Method | DELETE |
| URL | /api/v1/notes/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"message": "Note deleted successfully"
}Code Examples:
bash
curl -X DELETE "https://your-domain.com/api/v1/notes/1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$noteId = 1;
$response = $client->request('DELETE', "/api/v1/notes/{$noteId}", [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const noteId = 1;
const response = await fetch(`${BASE_URL}/api/v1/notes/${noteId}`, {
method: 'DELETE',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
note_id = 1
response = requests.delete(
f"{BASE_URL}/api/v1/notes/{note_id}",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
"strconv"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
noteId := 1
endpoint := baseURL + "/api/v1/notes/" + strconv.Itoa(noteId)
req, _ := http.NewRequest("DELETE", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let note_id = 1;
let response = client
.delete(format!("{BASE_URL}/api/v1/notes/{note_id}"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}