> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.barayuda.web.id/api-reference/swagger-plant-store-open-api-3-1/user/get-user-by-name/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.barayuda.web.id/_mcp/server. # Get user by username GET https://api.plantstore.dev/v3/user/{username} Retrieve user details using their username. Reference: https://docs.barayuda.web.id/api-reference/swagger-plant-store-open-api-3-1/user/get-user-by-name ## Request ### Path parameters - `username` (string, required) — Username of the user to retrieve ## Response ### 200 User details retrieved successfully - `id` (integer, optional) - `username` (string, optional) - `email` (string, optional) ## Examples **Request** ```json {} ``` **Response** ```json { "id": 42, "username": "alice_wonder", "email": "alice.wonderland@example.com" } ``` **SDK Code** ```python User details response import requests url = "https://api.plantstore.dev/v3/user/username" payload = {} headers = {"Content-Type": "application/json"} response = requests.get(url, json=payload, headers=headers) print(response.json()) ``` ```javascript User details response const url = 'https://api.plantstore.dev/v3/user/username'; const options = {method: 'GET', headers: {'Content-Type': 'application/json'}, body: '{}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go User details response package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.plantstore.dev/v3/user/username" payload := strings.NewReader("{}") req, _ := http.NewRequest("GET", url, payload) 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)) } ``` ```ruby User details response require 'uri' require 'net/http' url = URI("https://api.plantstore.dev/v3/user/username") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java User details response import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.plantstore.dev/v3/user/username") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php User details response request('GET', 'https://api.plantstore.dev/v3/user/username', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp User details response using RestSharp; var client = new RestClient("https://api.plantstore.dev/v3/user/username"); var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift User details response import Foundation let headers = ["Content-Type": "application/json"] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.plantstore.dev/v3/user/username")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```