# AI Studios - Professional History by Username POST /api/v1/aistudios/professional-history/{username}/ Content-Type: application/json **POST:** Get professional work experience history for a specific user by username. Returns a list of work experiences including job titles, companies, dates, and descriptions. Requires a publication URL in the POST body for access control. The username is provided as a path parameter. Returns work experiences ordered by most recent first. Reference: https://docs.aisquare.studio/api-reference/ai-square-studio-api/aistudios/professional-history-create ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: AISquare Studio API version: 1.0.0 paths: /api/v1/aistudios/professional-history/{username}/: post: operationId: professional-history-create summary: AI Studios - Professional History by Username description: >- **POST:** Get professional work experience history for a specific user by username. Returns a list of work experiences including job titles, companies, dates, and descriptions. Requires a publication URL in the POST body for access control. The username is provided as a path parameter. Returns work experiences ordered by most recent first. tags: - subpackage_aistudios parameters: - name: username in: path description: Username of the user whose work experiences to retrieve required: true schema: type: string responses: '200': description: Successfully retrieved user's work experiences content: application/json: schema: type: array items: $ref: '#/components/schemas/IAMUserWorkExperienceList' '400': description: Invalid publication URL or missing url content: application/json: schema: description: Any type '404': description: Publication or user not found content: application/json: schema: description: Any type requestBody: content: application/json: schema: type: object properties: url: type: string description: Publication custom URL for access control required: - url components: schemas: UserSimple: type: object properties: id: type: integer username: type: string description: >- Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. email: type: string format: email full_name: type: string first_time_login: type: boolean description: Check if this is the user's first login. theme: type: - string - 'null' is_superuser: type: boolean description: >- Designates that this user has all permissions without explicitly assigning them. is_staff: type: boolean description: Designates whether the user can log into this admin site. is_active: type: boolean description: >- Designates whether this user should be treated as active. Unselect this instead of deleting accounts. is_verified: type: boolean profile_picture: type: string format: uri description: |- Convert ImageFieldFile to URL string for JSON serialization. Args: obj: The model instance being serialized (typically IAMUser) Returns: str | None: The URL of the profile picture, or None if not available required: - id - username - email - first_time_login - profile_picture description: >- Mixin to handle profile_picture serialization for WebSocket compatibility. This mixin adds a SerializerMethodField for profile_picture that converts ImageFieldFile objects to URL strings, making them JSON serializable for WebSocket consumers. The mixin intelligently handles profile pictures from IAMUserDetail by: 1. Accessing the related `details` queryset on the IAMUser model 2. Extracting the ImageFieldFile from the first detail record 3. Converting it to a URL string for JSON serialization Usage: ```python class MyUserSerializer(ProfilePictureMixin, serializers.ModelSerializer): class Meta: model = User fields = ['id', 'username', 'profile_picture', ...] ``` Note: - This mixin expects the model to have a `details` related manager - The related detail should have a `profile_picture` ImageField - Returns None if no profile picture is found or an error occurs title: UserSimple EmploymentTypeEnum: type: string enum: - full_time - part_time - contract - internship - freelance - volunteer description: |- * `full_time` - Full Time * `part_time` - Part Time * `contract` - Contract * `internship` - Internship * `freelance` - Freelance * `volunteer` - Volunteer title: EmploymentTypeEnum BlankEnum: type: string enum: - '' title: BlankEnum NullEnum: description: Any type title: NullEnum IamUserWorkExperienceListEmploymentType: oneOf: - $ref: '#/components/schemas/EmploymentTypeEnum' - $ref: '#/components/schemas/BlankEnum' - $ref: '#/components/schemas/NullEnum' title: IamUserWorkExperienceListEmploymentType IAMUserWorkExperienceList: type: object properties: id: type: integer uid: type: string format: uuid user: $ref: '#/components/schemas/UserSimple' title: type: string company: type: string from_date: type: string format: date to_date: type: - string - 'null' format: date location: type: - string - 'null' employment_type: oneOf: - $ref: '#/components/schemas/IamUserWorkExperienceListEmploymentType' - type: 'null' employment_type_display: type: string description: type: - string - 'null' created_at: type: string format: date-time required: - id - uid - user - title - company - from_date - employment_type_display - created_at description: Simple serializer for listing work experiences with user info title: IAMUserWorkExperienceList ``` ## SDK Code Examples ```python Professional History Response import requests url = "https://api.example.com/api/v1/aistudios/professional-history/username/" payload = { "url": "ai-research-studio" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Professional History Response const url = 'https://api.example.com/api/v1/aistudios/professional-history/username/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"url":"ai-research-studio"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Professional History Response package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/aistudios/professional-history/username/" payload := strings.NewReader("{\n \"url\": \"ai-research-studio\"\n}") req, _ := http.NewRequest("POST", 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 Professional History Response require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/aistudios/professional-history/username/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"url\": \"ai-research-studio\"\n}" response = http.request(request) puts response.read_body ``` ```java Professional History Response import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.example.com/api/v1/aistudios/professional-history/username/") .header("Content-Type", "application/json") .body("{\n \"url\": \"ai-research-studio\"\n}") .asString(); ``` ```php Professional History Response request('POST', 'https://api.example.com/api/v1/aistudios/professional-history/username/', [ 'body' => '{ "url": "ai-research-studio" }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Professional History Response using RestSharp; var client = new RestClient("https://api.example.com/api/v1/aistudios/professional-history/username/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"url\": \"ai-research-studio\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Professional History Response import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["url": "ai-research-studio"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/aistudios/professional-history/username/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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() ``` ```python Professional History Request import requests url = "https://api.example.com/api/v1/aistudios/professional-history/username/" payload = { "url": "ai-research-studio" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Professional History Request const url = 'https://api.example.com/api/v1/aistudios/professional-history/username/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"url":"ai-research-studio"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Professional History Request package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/aistudios/professional-history/username/" payload := strings.NewReader("{\n \"url\": \"ai-research-studio\"\n}") req, _ := http.NewRequest("POST", 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 Professional History Request require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/aistudios/professional-history/username/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"url\": \"ai-research-studio\"\n}" response = http.request(request) puts response.read_body ``` ```java Professional History Request import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.example.com/api/v1/aistudios/professional-history/username/") .header("Content-Type", "application/json") .body("{\n \"url\": \"ai-research-studio\"\n}") .asString(); ``` ```php Professional History Request request('POST', 'https://api.example.com/api/v1/aistudios/professional-history/username/', [ 'body' => '{ "url": "ai-research-studio" }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Professional History Request using RestSharp; var client = new RestClient("https://api.example.com/api/v1/aistudios/professional-history/username/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"url\": \"ai-research-studio\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Professional History Request import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["url": "ai-research-studio"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/aistudios/professional-history/username/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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() ```