Leave Guild
API to leave a guild.
URL Confirmation
This API uses the service-api.playnanoo.com domain.
API Information
- URL:
https://service-api.playnanoo.com/guild/v20230101/personal/withdraw - Method:
PUT - Authentication Required: Yes
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| table_code | string | Required | Table code |
DeviceInfo Inheritance
The Req class of this API inherits from DeviceInfo. All properties of DeviceInfo are automatically included.
Response Data
Res Class
| Field | Type | Description |
|---|---|---|
| Status | string | Processing status |
Unity C# Implementation
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class GuildPersonalWithdraw
{
static string path = "https://service-api.playnanoo.com/guild/v20230101/personal/withdraw";
[Serializable]
public class Req : DeviceInfo
{
public string table_code;
public IEnumerator Send(
string tableCode,
Action<Res> onSuccess,
Action<BaseResponse> onError
)
{
if (!string.IsNullOrEmpty(tableCode)) this.table_code = tableCode;
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}
[Serializable]
public class Res : BaseResponse
{
public string Status;
}
}
Usage Example
public void WithdrawFromGuild()
{
GuildPersonalWithdraw.Req req = new GuildPersonalWithdraw.Req();
StartCoroutine(req.Send(
tableCode: "guild_table",
onSuccess: res =>
{
Debug.Log($"Status: {res.Status}");
},
onError: (error) =>
{
Debug.LogError($"Guild leave failed: [{error.ErrorCode}] {error.Message}");
}
));
}