Users


Get User Information

This API allows you to retrieve the details of the currently authenticated user.
GEThttps://api-ipfs.attoaioz.cyou/api/users/me

Parameters

Header

Authorization*
JWT

Response

200: OK
{
    "data": {
        "user": {
            "id": "string",
            "first_name": "string",
            "last_name": "string",
            "email": "string",
            "wallet_address": "string",
            "role": "string",
            "created_at": "2023-05-11T11:11:11.111111Z",
            "updated_at": "2023-06-11T11:11:11.111111Z"
        }
    },
    "status": "success"
}
curl --location --request GET 'https://api-ipfs.attoaioz.cyou/api/users/me' \
--header 'Authorization: Bearer JWT'
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api-ipfs.attoaioz.cyou/api/users/me',
  headers: { 
    'Authorization': 'Bearer JWT'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

import requests

url = "https://api-ipfs.attoaioz.cyou/api/users/me"

payload={}
headers = {
  'Authorization': 'Bearer JWT'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-ipfs.attoaioz.cyou/api/users/me"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer JWT")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Edit User

Edit the first name and last name of the user's profile
The request body when edit will look like this:
{
    first_name: string,
    last_name: string
}
PUThttps://api-ipfs.attoaioz.cyou/api/users/editProfile

Parameters

Header

Authorization*
JWT

Body

first_name
First name
last_name
Last name

Response

200: OK
{
    "message": "Profile updated successfully",
    "status": "success"
}
curl --location --request PUT 'https://api-ipfs.attoaioz.cyou/api/users/editProfile' \
--header 'Authorization: Bearer JWT' \
--header 'Content-Type: application/json' \
--data-raw '{
    "first_name": "First",
    "last_name": "Last"
}'
var axios = require('axios');
var data = JSON.stringify({
  "first_name": "First",
  "last_name": "Last"
});

var config = {
  method: 'put',
  url: 'https://api-ipfs.attoaioz.cyou/api/users/editProfile',
  headers: { 
    'Authorization': 'Bearer JWT', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
import requests
import json

url = "https://api-ipfs.attoaioz.cyou/api/users/editProfile"

payload = json.dumps({
  "first_name": "First",
  "last_name": "Last"
})
headers = {
  'Authorization': 'Bearer JWT',
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-ipfs.attoaioz.cyou/api/users/editProfile"
  method := "PUT"

  payload := strings.NewReader(`{
    "first_name": "First",
    "last_name": "Last"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer JWT")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

ON THIS PAGE