Archive a bond via Ethos Everywhere wallet
using System.Net.Http.Headers;var clientHandler = new HttpClientHandler{ UseCookies = false,};var client = new HttpClient(clientHandler);var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.ethos.network/api/v2/wallets/activity/bond/1/archive"), Headers = { { "cookie", "ethos-access-token=<ethos-access-token>" }, }, Content = new StringContent("{ \"archiveReason\": \"example\", \"waitForTxTimeoutSeconds\": 5 }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.ethos.network/api/v2/wallets/activity/bond/1/archive"
payload := strings.NewReader("{ \"archiveReason\": \"example\", \"waitForTxTimeoutSeconds\": 5 }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "ethos-access-token=<ethos-access-token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"archiveReason\": \"example\", \"waitForTxTimeoutSeconds\": 5 }");Request request = new Request.Builder() .url("https://api.ethos.network/api/v2/wallets/activity/bond/1/archive") .post(body) .addHeader("cookie", "ethos-access-token=<ethos-access-token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.ethos.network/api/v2/wallets/activity/bond/1/archive', headers: { cookie: 'ethos-access-token=<ethos-access-token>', 'Content-Type': 'application/json' }, data: {archiveReason: 'example', waitForTxTimeoutSeconds: 5}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.ethos.network/api/v2/wallets/activity/bond/1/archive';const options = { method: 'POST', headers: { cookie: 'ethos-access-token=<ethos-access-token>', 'Content-Type': 'application/json' }, body: '{"archiveReason":"example","waitForTxTimeoutSeconds":5}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.ethos.network/api/v2/wallets/activity/bond/1/archive";
let payload = json!({ "archiveReason": "example", "waitForTxTimeoutSeconds": 5 });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("cookie", "ethos-access-token=<ethos-access-token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://api.ethos.network/api/v2/wallets/activity/bond/1/archive \ --header 'Content-Type: application/json' \ --cookie ethos-access-token=<ethos-access-token> \ --data '{ "archiveReason": "example", "waitForTxTimeoutSeconds": 5 }'wget --quiet \ --method POST \ --header 'cookie: ethos-access-token=<ethos-access-token>' \ --header 'Content-Type: application/json' \ --body-data '{ "archiveReason": "example", "waitForTxTimeoutSeconds": 5 }' \ --output-document \ - https://api.ethos.network/api/v2/wallets/activity/bond/1/archiveArchives a bond using the user’s Ethos Everywhere wallet. > ⚠️ Warning: This is a beta endpoint. It is not guaranteed to be stable and may change or break without notice.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Timeout in seconds to wait for the transaction to be processed by Ethos. Defaults to 5 seconds. Set to 0 to skip waiting.
Responses
Section titled “Responses”Successful response
object
0x-prefixed 32-byte transaction hash (keccak256)
Example generated
{ "hash": "example"}Invalid input data
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "BAD_REQUEST", "message": "Invalid input data", "issues": []}Authorization not provided
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "UNAUTHORIZED", "message": "Authorization not provided", "issues": []}Insufficient access
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "FORBIDDEN", "message": "Insufficient access", "issues": []}Internal server error
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "INTERNAL_SERVER_ERROR", "message": "Internal server error", "issues": []}