# List Quests by Publication URL GET /api/v1/quests/by-url/ This endpoint returns a paginated list of quests. For GET requests, it returns the base quest list. For POST requests, if the JSON body contains a 'url' parameter (representing the publication's custom URL), the view will filter the quests to return only those whose 'created_by' matches the Publication owner's user. If the 'url' parameter is omitted, the full list is returned. Reference: https://docs.aisquare.studio/api-reference/ai-square-studio-api/quests/by-url-list ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: AISquare Studio API version: 1.0.0 paths: /api/v1/quests/by-url/: get: operationId: by-url-list summary: List Quests by Publication URL description: >- This endpoint returns a paginated list of quests. For GET requests, it returns the base quest list. For POST requests, if the JSON body contains a 'url' parameter (representing the publication's custom URL), the view will filter the quests to return only those whose 'created_by' matches the Publication owner's user. If the 'url' parameter is omitted, the full list is returned. tags: - subpackage_quests parameters: - name: category in: query required: false schema: type: string - name: creation_status in: query description: |- * `not_started` - Not Started * `in_progress` - In Progress * `completed` - Completed * `failed` - Failed required: false schema: $ref: '#/components/schemas/ApiV1QuestsByUrlGetParametersCreationStatus' - name: ordering in: query description: |- Ordering * `created_at` - Created at * `-created_at` - Created at (descending) * `name` - Name * `-name` - Name (descending) * `popularity` - Popularity * `-popularity` - Popularity (descending) required: false schema: type: array items: $ref: >- #/components/schemas/ApiV1QuestsByUrlGetParametersOrderingSchemaItems - name: owned in: query required: false schema: type: boolean - name: page in: query description: A page number within the paginated result set. required: false schema: type: integer - name: page_size in: query description: Number of results to return per page. required: false schema: type: integer - name: player_level in: query required: false schema: type: string - name: saved in: query required: false schema: type: boolean - name: search in: query required: false schema: type: string - name: subcategory in: query required: false schema: type: string - name: tags in: query required: false schema: type: array items: type: integer - name: visibility in: query description: |- * `public` - Public * `private` - Private * `team` - Team * `org` - Organization required: false schema: $ref: '#/components/schemas/ApiV1QuestsByUrlGetParametersVisibility' responses: '200': description: >- A paginated list of quests. If a 'url' is provided in the POST body, only quests created by the corresponding Publication owner are returned. content: application/json: schema: $ref: '#/components/schemas/PaginatedQuestList' '400': description: Invalid input content: application/json: schema: description: Any type '401': description: Unauthorized content: application/json: schema: description: Any type components: schemas: ApiV1QuestsByUrlGetParametersCreationStatus: type: string enum: - completed - failed - in_progress - not_started title: ApiV1QuestsByUrlGetParametersCreationStatus ApiV1QuestsByUrlGetParametersOrderingSchemaItems: type: string enum: - '-created_at' - '-name' - '-popularity' - created_at - name - popularity title: ApiV1QuestsByUrlGetParametersOrderingSchemaItems ApiV1QuestsByUrlGetParametersVisibility: type: string enum: - org - private - public - team title: ApiV1QuestsByUrlGetParametersVisibility MinimalPlayerLevel: type: object properties: id: type: integer uid: type: string format: uuid name: type: string description: type: - string - 'null' avg_score: type: integer required: - id - uid - name description: Minimal serializer for PlayerLevel to be used in other modules title: MinimalPlayerLevel GlobalVisibilityEnum: type: string enum: - public - private - team - org description: |- * `public` - Public * `private` - Private * `team` - Team * `org` - Organization title: GlobalVisibilityEnum GlobalCreationStatusEnum: type: string enum: - not_started - in_progress - completed - failed description: |- * `not_started` - Not Started * `in_progress` - In Progress * `completed` - Completed * `failed` - Failed title: GlobalCreationStatusEnum 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 Quest: type: object properties: id: type: integer uid: type: string format: uuid name: type: string urls: type: array items: type: string files: type: - array - 'null' items: type: string format: uri logo: type: - string - 'null' format: uri cover: type: - string - 'null' format: uri tags: type: array items: description: Any type category: type: string subcategory: type: string player_level: $ref: '#/components/schemas/MinimalPlayerLevel' learnings: oneOf: - description: Any type - type: 'null' quiz_format: oneOf: - description: Any type - type: 'null' focus_area: type: - string - 'null' recommended_skills: oneOf: - description: Any type - type: 'null' description: List of recommended skills for this quest visibility: $ref: '#/components/schemas/GlobalVisibilityEnum' summary: type: - string - 'null' description: type: - string - 'null' co_creators: type: array items: description: Any type creation_status: $ref: '#/components/schemas/GlobalCreationStatusEnum' metrics: type: string created_by: $ref: '#/components/schemas/MinimalIAMUser' created_at: type: string format: date-time publication_url: type: - string - 'null' description: Get the publication URL from the quest's source experience publication: type: - object - 'null' additionalProperties: description: Any type description: Get the publication from the quest's source experience user_added_quest: type: boolean description: Check if the current user has added this quest updated_at: type: string format: date-time workspace_id: type: integer required: - id - uid - name - player_level - metrics - created_by - created_at - publication_url - publication - user_added_quest - updated_at - workspace_id description: Mixin to add user_added_quest field to quest serializers title: Quest PaginatedQuestList: type: object properties: count: type: integer next: type: - string - 'null' format: uri previous: type: - string - 'null' format: uri results: type: array items: $ref: '#/components/schemas/Quest' required: - count - results title: PaginatedQuestList ``` ## SDK Code Examples ```python import requests url = "https://api.example.com/api/v1/quests/by-url/" payload = {} headers = {"Content-Type": "application/json"} response = requests.get(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.example.com/api/v1/quests/by-url/'; 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 package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/quests/by-url/" 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 require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/quests/by-url/") 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 import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.example.com/api/v1/quests/by-url/") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('GET', 'https://api.example.com/api/v1/quests/by-url/', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.example.com/api/v1/quests/by-url/"); var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift 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.example.com/api/v1/quests/by-url/")! 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() ```