# List Blogs by Publication URL POST /api/v1/publications/blogs/ Content-Type: application/json Accepts a POST request with a JSON body containing a 'url' parameter (representing the publication's custom URL) and returns a paginated list of public blogs. Reference: https://docs.aisquare.studio/api-reference/ai-square-studio-api/publications/blogs-list-by-url ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: AISquare Studio API version: 1.0.0 paths: /api/v1/publications/blogs/: post: operationId: blogs-list-by-url summary: List Blogs by Publication URL description: >- Accepts a POST request with a JSON body containing a 'url' parameter (representing the publication's custom URL) and returns a paginated list of public blogs. tags: - subpackage_publications responses: '200': description: >- A paginated list of blogs for the publication identified by the provided URL. content: application/json: schema: $ref: '#/components/schemas/BlogList' '400': description: Missing URL parameter content: application/json: schema: description: Any type '404': description: Publication not found content: application/json: schema: description: Any type requestBody: content: application/json: schema: type: object properties: url: type: string description: Publication custom URL. required: - url components: schemas: GlobalVisibilityEnum: type: string enum: - public - private - team - org description: |- * `public` - Public * `private` - Private * `team` - Team * `org` - Organization title: GlobalVisibilityEnum BlogTypeEnum: type: string enum: - free - paid description: |- * `free` - Free * `paid` - Paid title: BlogTypeEnum MinimalIAMUserDetail: type: object properties: profile_picture: type: - string - 'null' format: uri bio: type: - string - 'null' country: type: - string - 'null' phone: type: - string - 'null' linkedin_url: type: - string - 'null' format: uri github_url: type: - string - 'null' format: uri twitter_url: type: - string - 'null' format: uri website_url: type: - string - 'null' format: uri top_domain_elo: type: number format: double top_domain_rank: type: integer required: - profile_picture - bio - country - phone - linkedin_url - github_url - twitter_url - website_url - top_domain_elo - top_domain_rank title: MinimalIAMUserDetail MinimalIAMUser: 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 is_verified: type: boolean details: type: array items: $ref: '#/components/schemas/MinimalIAMUserDetail' followers_count: type: integer required: - id - username - email - full_name - is_verified - details - followers_count title: MinimalIAMUser BlogList: type: object properties: id: type: integer uid: type: string format: uuid created_at: type: string format: date-time updated_at: type: string format: date-time deleted_at: type: - string - 'null' format: date-time is_active: type: boolean created_by: type: - string - 'null' updated_by: type: - string - 'null' deleted_by: type: - string - 'null' publication: type: - integer - 'null' description: Publication this blog belongs to. Can be null for standalone blogs. publication_id: type: integer publication_custom_url: type: string publication_name: type: string title: type: string cover_image: type: - string - 'null' format: uri content: type: - string - 'null' source_experience: type: - integer - 'null' description: The experience this blog was created from category_name: type: string subcategory_name: type: string focus_area: type: - string - 'null' tags: type: array items: description: Any type visibility: $ref: '#/components/schemas/GlobalVisibilityEnum' is_draft: type: boolean description: Whether this blog is a draft disable_comments: type: boolean type: $ref: '#/components/schemas/BlogTypeEnum' schedule_date: type: - string - 'null' format: date-time published_date: type: - string - 'null' format: date-time owner: $ref: '#/components/schemas/MinimalIAMUser' status: type: string user_bookmarked: type: boolean summary: type: object additionalProperties: type: string publisher_name: type: string publisher_creator: $ref: '#/components/schemas/MinimalIAMUser' reading_time: type: string metrics: type: string generation_status: type: string has_generation_in_progress: type: string is_ready_for_review: type: string required: - id - uid - created_at - updated_at - publication - publication_custom_url - publication_name - title - source_experience - category_name - subcategory_name - owner - status - user_bookmarked - summary - publisher_name - publisher_creator - reading_time - metrics - generation_status - has_generation_in_progress - is_ready_for_review title: BlogList ``` ## SDK Code Examples ```python import requests url = "https://api.example.com/api/v1/publications/blogs/" payload = { "url": "techinsights" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.example.com/api/v1/publications/blogs/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"url":"techinsights"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/publications/blogs/" payload := strings.NewReader("{\n \"url\": \"techinsights\"\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 require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/publications/blogs/") 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\": \"techinsights\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.example.com/api/v1/publications/blogs/") .header("Content-Type", "application/json") .body("{\n \"url\": \"techinsights\"\n}") .asString(); ``` ```php request('POST', 'https://api.example.com/api/v1/publications/blogs/', [ 'body' => '{ "url": "techinsights" }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.example.com/api/v1/publications/blogs/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"url\": \"techinsights\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["url": "techinsights"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/publications/blogs/")! 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() ```