Application
Definition
- JSON
- Typescript
application.json
{
"id": 0,
"applicationKey": "",
"applicationName": "",
"applicationDescription": "",
"clientID": "",
"clientSecret": "",
"redirectUri": "",
"status": 0,
"createdAt": "",
"updatedAt": "",
}
application.ts
export interface IApplication {
id: number;
applicationKey: string;
applicationName: string;
applicationDescription: string | null;
clientID: string;
clientSecret: string;
redirectUri: string;
status: number;
createdAt: Date | null;
updatedAt: Date | null;
}
Get Applications
- Curl
- Typescript
curl -X GET "${baseUrl}/application/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const response = await fetch("${baseUrl}/application/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Get Application
- Curl
- Typescript
curl -X GET "${baseUrl}/application/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const response = await fetch("${baseUrl}/application/${id}", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Apply Application.ID
- Curl
- Typescript
curl -X POST "${baseUrl}/apply/application/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const response = await fetch("${baseUrl}/apply/application/id/", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: JSON.stringify(payload),
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Create Application
- Curl
- Typescript
curl -X POST "${baseUrl}/application/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @application.json
info
application.json
{
"applicationKey": "",
"applicationName": "",
"applicationDescription": "",
"clientID": "",
"redirectUri": "",
"status": 0,
}
tip
success status: 201
const response = await fetch("${baseUrl}/application/", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: JSON.stringify(payload),
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Update Application
- Curl
- Typescript
#!/bin/bash
curl -X PUT "${baseUrl}/application/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @application.json
info
application.json
{
"applicationKey": "",
"applicationName": "",
"applicationDescription": "",
"clientID": "",
"redirectUri": "",
"status": 0,
}
const response = await fetch("${baseUrl}/application/${id}", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: JSON.stringify(payload),
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Patch Application
- Curl
- Typescript
curl -X PATCH "${baseUrl}/application/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: applicationKey,applicationName,applicationDescription,clientID,redirectUri,status" \
-d @application.json
info
application.json
{
"applicationKey": "",
"applicationName": "",
"applicationDescription": "",
"clientID": "",
"redirectUri": "",
"status": 0,
}
const response = await fetch("${baseUrl}/application/${id}", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
"Attrs": "${attrs}",
},
body: JSON.stringify(payload),
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Update Application Status
- Curl
- Typescript
curl -X PATCH "${baseUrl}/application/${id}/status/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @application.json
info
application.json
{
"status": 0
}
const response = await fetch("${baseUrl}/application/${id}/status/", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: JSON.stringify(payload),
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Destroy Application
- Curl
- Typescript
curl -X DELETE "${baseUrl}/application/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const response = await fetch("${baseUrl}/application/${id}", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Get Roles
- Curl
- Typescript
curl -X GET "${baseUrl}/application/${id}/role/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const response = await fetch("${baseUrl}/application/${id}/role/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Link Roles
- Curl
- Typescript
curl -X POST "${baseUrl}/application/${id}/role/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
const response = await fetch("${baseUrl}/application/${id}/role/", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: "[1,2,3,4]",
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
UnLink Roles
- Curl
- Typescript
curl -X DELETE "${baseUrl}/application/${id}/role/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
const response = await fetch("${baseUrl}/application/${id}/role/", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: "[1,2,3,4]",
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Get ApplicationRole
- Curl
- Typescript
curl -X GET "${baseUrl}/application/${id}/role/${roleID}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const response = await fetch("${baseUrl}/application/${id}/role/${roleID}", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Update ApplicationRole
- Curl
- Typescript
curl -X PUT "${baseUrl}/application/${id}/role/${roleID}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @applicationRole.json
info
applicationRole.json
{
"right": 0,
}
const response = await fetch("${baseUrl}/application/${id}/role/${roleID}", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: JSON.stringify(payload),
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Get Users
- Curl
- Typescript
curl -X GET "${baseUrl}/application/${id}/user/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const response = await fetch("${baseUrl}/application/${id}/user/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Link Users
- Curl
- Typescript
curl -X POST "${baseUrl}/application/${id}/user/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
const response = await fetch("${baseUrl}/application/${id}/user/", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: "[1,2,3,4]",
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
UnLink Users
- Curl
- Typescript
curl -X DELETE "${baseUrl}/application/${id}/user/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
const response = await fetch("${baseUrl}/application/${id}/user/", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: "[1,2,3,4]",
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Get ApplicationUser
- Curl
- Typescript
curl -X GET "${baseUrl}/application/${id}/user/${userID}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const response = await fetch("${baseUrl}/application/${id}/user/${userID}", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}
Update ApplicationUser
- Curl
- Typescript
curl -X PUT "${baseUrl}/application/${id}/user/${userID}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @applicationUser.json
info
applicationUser.json
{
"right": 0,
}
const response = await fetch("${baseUrl}/application/${id}/user/${userID}", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": `Bearer ${accessToken}`,
},
body: JSON.stringify(payload),
})
const data = await response.json();
if (!response.ok) {
throw new Error(data);
}