مرجع API · Settings
Update brand & competitors
put
/settings/brand| احراز هویت | توکن مشتری (Bearer) |
|---|---|
| سطح دسترسی | کاربر رایگان · کاربر حرفهای Customer token (Bearer) — free and paid users |
Saves name variants, extra domains and competitors (order = importance). A competitor change rebuilds only competitor/comparison questions.
بدنه درخواست
| فیلد | نوع | توضیح |
|---|---|---|
name_variants* | string | null[] | max 10, each max 100 |
extra_domains* | string | null[] | max 5 valid hosts |
competitors* | object[] | 1–5 |
competitors[].id | integer | null | Unique ID. |
competitors[].name* | string | |
competitors[].domain | string | null | Site domain. |
نمونهjson
{
"name_variants": [
"Avand",
"آوند حساب",
"اوند"
],
"extra_domains": [
"blog.avand.example"
],
"competitors": [
{
"id": 163,
"name": "نیکحساب",
"domain": "nikhesab.example"
},
{
"id": 164,
"name": "ترازنو",
"domain": "taraznoo.example"
},
{
"id": 165,
"name": "دفتریار",
"domain": "daftaryar.example"
},
{
"id": 166,
"name": "رایاندفتر",
"domain": "rayandaftar.example"
},
{
"id": 167,
"name": "مهرگانسیستم",
"domain": "mehregan.example"
}
]
}
پاسخها
200 — same as GET
| فیلد | نوع | توضیح |
|---|---|---|
name* | string | null | |
domain* | string | null | Site domain. |
name_variants* | any[] | |
extra_domains* | any[] | |
competitors* | object[] | |
competitors[].id* | integer | Unique ID. |
competitors[].name* | string | |
competitors[].domain* | string | null | Site domain. |
competitors[].position* | integer | |
competitors[].source* | string |
json
{
"…": "GET /settings/brand body after saving"
}
401 — Missing/invalid token, or a token of the wrong owner (admin token on a user route or vice versa): {"message":"…","code":"unauthenticated"} (message in the request language)
| فیلد | نوع |
|---|---|
message* | string |
code | string |
json
{
"message": "Please sign in to continue; your session has ended or is not valid.",
"code": "unauthenticated"
}
422 — Validation failed (extra_domains.N, competitors.N.name (is the brand / duplicate), competitors.N.domain)
| فیلد | نوع |
|---|---|
message* | string |
errors* | object |
json
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
نمونهٔ curl
bash
curl -X PUT 'http://127.0.0.1:8010/api/settings/brand' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name_variants": [
"Avand",
"آوند حساب",
"اوند"
],
"extra_domains": [
"blog.avand.example"
],
"competitors": [
{
"id": 163,
"name": "نیکحساب",
"domain": "nikhesab.example"
},
{
"id": 164,
"name": "ترازنو",
"domain": "taraznoo.example"
},
{
"id": 165,
"name": "دفتریار",
"domain": "daftaryar.example"
},
{
"id": 166,
"name": "رایاندفتر",
"domain": "rayandaftar.example"
},
{
"id": 167,
"name": "مهرگانسیستم",
"domain": "mehregan.example"
}
]
}'