Skip to content

arminpasalic10/Catroweb-API

 
 

Repository files navigation

OpenAPIServer

API for the Catrobat Share Platform

This Symfony bundle is automatically generated by the OpenAPI Generator project:

  • API version: v1.0.42
  • Build package: org.openapitools.codegen.languages.PhpSymfonyServerCodegen For more information, please visit https://share.catrob.at

Requirements

PHP 7.1.3 and later

Installation & Usage

To install the dependencies via Composer, add the following repository to composer.json of your Symfony project:

{
    "repositories": [{
        "type": "path",
        "url": "//Path to your generated openapi bundle"
    }],
}

Then run:

composer require GIT_USER_ID/GIT_REPO_ID:dev-master

to add the generated openapi bundle as a dependency.

Tests

To run the unit tests for the generated bundle, first navigate to the directory containing the code, then run the following commands:

composer install
./vendor/bin/phpunit

Getting Started

Step 1: Please follow the installation procedure first.

Step 2: Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new OpenAPI\Server\OpenAPIServerBundle(),
        // ...
    );
}

Step 3: Register the routes:

# app/config/routing.yml
open_api_server:
    resource: "@OpenAPIServerBundle/Resources/config/routing.yml"

Step 4: Implement the API calls:

<?php
// src/Acme/MyBundle/Api/AuthenticationApiInterface.php

namespace Acme\MyBundle\Api;

use OpenAPI\Server\Api\AuthenticationApiInterface;

class AuthenticationApi implements AuthenticationApiInterface // An interface is autogenerated
{

    /**
     * Implementation of AuthenticationApiInterface#authenticationGet
     */
    public function authenticationGet()
    {
        // Implement the operation ...
    }

    // Other operation methods ...
}

Step 5: Tag your API implementation:

# src/Acme/MyBundle/Resources/services.yml
services:
    # ...
    acme.my_bundle.api.authentication:
        class: Acme\MyBundle\Api\AuthenticationApi
        tags:
            - { name: "open_api_server.api", api: "authentication" }
    # ...

Now you can start using the bundle!

Documentation for API Endpoints

All URIs are relative to https://share.catrob.at/api

Class Method HTTP request Description
AuthenticationApiInterface authenticationGet GET /authentication Check token
AuthenticationApiInterface authenticationOauthPost POST /authentication/oauth OAuth Login
AuthenticationApiInterface authenticationPost POST /authentication Login
MediaLibraryApiInterface mediaFileIdGet GET /media/file/{id} Get the information of a specific media file
MediaLibraryApiInterface mediaFilesGet GET /media/files Get all content of the media library.
MediaLibraryApiInterface mediaFilesSearchGet GET /media/files/search Search for mediafiles associated with keywords
MediaLibraryApiInterface mediaPackageNameGet GET /media/package/{name} Get media-library asstes of a named package
ProjectsApiInterface projectIdGet GET /project/{id} Get the information of a project
ProjectsApiInterface projectsFeaturedGet GET /projects/featured Get the currently featured projects
ProjectsApiInterface projectsGet GET /projects Get projects
ProjectsApiInterface projectsPost POST /projects Upload a catrobat project
ProjectsApiInterface projectsSearchGet GET /projects/search Search for projects associated with a keywords
ProjectsApiInterface projectsUserGet GET /projects/user/ Get the projects of the logged in user
ProjectsApiInterface projectsUserIdGet GET /projects/user/{id} Get the public projects of a given user
UserApiInterface userDelete DELETE /user Delete user account
UserApiInterface userGet GET /user Get your private user data
UserApiInterface userIdGet GET /user/{id} Get public user data
UserApiInterface userPost POST /user Register
UserApiInterface userPut PUT /user Update User
UserApiInterface usersSearchGet GET /users/search Search for users
UtilityApiInterface healthGet GET /health Health Check

Documentation For Models

Documentation For Authorization

PandaAuth

  • Type: HTTP basic authentication

Author

webmaster@catrobat.org

About

Catroweb API Package & Documentation

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.2%
  • Shell 0.8%