Add Contribution Points
API to add contribution points for a guild member.
URL Confirmation
This API uses the service-api.playnanoo.com domain.
API Information
- URL:
https://service-api.playnanoo.com/guild/v20230101/personal/point - Method:
PUT - Authentication Required: Yes
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| table_code | string | Required | Table code |
| point | double | Required | Points to add |
| extra_data | string | Yes | Extra data |
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 GuildPersonalPoint
{
static string path = "https://service-api.playnanoo.com/guild/v20230101/personal/point";
[Serializable]
public class Req : DeviceInfo
{
public string table_code;
public double point;
public string extra_data;
public IEnumerator Send(
string tableCode,
double point,
string extraData,
Action<Res> onSuccess,
Action<BaseResponse> onError
)
{
if (!string.IsNullOrEmpty(tableCode)) this.table_code = tableCode;
this.point = point;
if (!string.IsNullOrEmpty(extraData)) this.extra_data = extraData;
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 AddGuildPoint()
{
GuildPersonalPoint.Req req = new GuildPersonalPoint.Req();
StartCoroutine(req.Send(
tableCode: "guild_table",
point: 100,
extraData: "quest_complete",
onSuccess: res =>
{
Debug.Log($"Status: {res.Status}");
},
onError: (error) =>
{
Debug.LogError($"Point addition failed: [{error.ErrorCode}] {error.Message}");
}
));
}