Skip to content

Kropiunig/Catroweb-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

218 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.71
  • 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#authenticationDelete
     */
    public function authenticationDelete(string $x_refresh)
    {
        // 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 authenticationDelete DELETE /authentication Expires refresh token
AuthenticationApiInterface authenticationGet GET /authentication Check token
AuthenticationApiInterface authenticationOauthPost POST /authentication/oauth OAuth Login
AuthenticationApiInterface authenticationPost POST /authentication Login
AuthenticationApiInterface authenticationRefreshPost POST /authentication/refresh Refresh token -- StatusCode: 501 - Not yet implemented
AuthenticationApiInterface authenticationUpgradePost POST /authentication/upgrade Upgrade a deprecated token to JWT
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
NotificationsApiInterface notificationIdReadPut PUT /notification/{id}/read Mark specified notification as read - StatusCode: 501 - Not yet implemented
NotificationsApiInterface notificationsCountGet GET /notifications/count Count the number of unseen notifications -- StatusCode: 501 - Not yet implemented
NotificationsApiInterface notificationsGet GET /notifications Get user notifications -- StatusCode: 501 - Not yet implemented
NotificationsApiInterface notificationsReadPut PUT /notifications/read Mark all notifications as read -- StatusCode: 501 - Not yet implemented
ProjectsApiInterface projectIdDelete DELETE /project/{id} Delete a project -- StatusCode: 501 - Not yet implemented
ProjectsApiInterface projectIdGet GET /project/{id} Get the information of a project
ProjectsApiInterface projectIdRecommendationsGet GET /project/{id}/recommendations Get recommended projects related to the specific project
ProjectsApiInterface projectIdReportPost POST /project/{id}/report Report a project -- StatusCode: 501 - Not yet implemented
ProjectsApiInterface projectsCategoriesGet GET /projects/categories Get default number of projects per category (Most downloaded etc.)
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
SearchApiInterface searchGet GET /search Search for projects, users,.. -- StatusCode: 501 - Not yet implemented
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 userResetPasswordPost POST /user/reset-password Request email to reset password
UserApiInterface usersSearchGet GET /users/search Search for users
UtilityApiInterface healthGet GET /health Health Check
UtilityApiInterface surveyLangCodeGet GET /survey/{lang_code} Get survey link for given language code.

Documentation For Models

Documentation For Authorization

PandaAuth

  • Type: HTTP basic authentication

Author

webmaster@catrobat.org

About

Catroweb API Package & Documentation

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.3%
  • Shell 0.7%