# Get user by username GET https://api.plantstore.dev/v3/user/{username} Retrieve user details using their username. Reference: https://docs.getinstacash.in/api-reference/swagger-plant-store-open-api-3-1/user/get-user-by-name ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: example-openapi version: 1.0.0 paths: /user/{username}: get: operationId: get-user-by-name summary: Get user by username description: Retrieve user details using their username. tags: - subpackage_user parameters: - name: username in: path description: Username of the user to retrieve required: true schema: type: string responses: '200': description: User details retrieved successfully content: application/json: schema: $ref: '#/components/schemas/User' servers: - url: https://api.plantstore.dev/v3 components: schemas: User: type: object properties: id: type: integer username: type: string email: type: string title: User ``` ## SDK Code Examples ```python User details response import requests url = "https://api.plantstore.dev/v3/user/username" response = requests.get(url) print(response.json()) ``` ```javascript User details response const url = 'https://api.plantstore.dev/v3/user/username'; const options = {method: 'GET'}; 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" "net/http" "io" ) func main() { url := "https://api.plantstore.dev/v3/user/username" req, _ := http.NewRequest("GET", url, nil) 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) 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") .asString(); ``` ```php User details response request('GET', 'https://api.plantstore.dev/v3/user/username'); 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); IRestResponse response = client.Execute(request); ``` ```swift User details response import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.plantstore.dev/v3/user/username")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" 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() ```