Giter Site home page Giter Site logo

xenapi's Introduction

Logo

Build Status

This is a simple XenForo API for Java.


Summary


XenAPI for Xenforo 1.X

This repo contains only a framework for Xenforo 2.X.

v1.X of Xenforo will not be developed anymore. If you need the old API you can grab it from here.

Downloads & Repo

All downloads are hosted in Github.

For the Java-API, you can add it on Maven:

    <repositories>
        <repository>
            <id>XenAPI Repo</id>
            <url>https://cadox8.es/repo</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>es.cadox8</groupId>
            <artifactId>XenAPI</artifactId>
            <version>RELEASE</version>
        </dependency>
    </dependencies>

NOTE: You can use RELEASE as version or you can use the version number (you can check all versions here)

Documentation

Web-API & Java-API: You can get the documentation here.

Javadocs: You can check the Javadocs here.

Bug Reporting

You can create an issue here on GitHub to report a bug with the API or to suggest enhancements.

Contributing

If you want to contribute to the project, you must accept and follow our Code Of Conduct and our guides for contributing.

Instalation

Usage & API Key

You will need to enable API in your XenForo. You can use this guide.

Dependencies

The XenAPI (Java) has the following dependencies:

License & Copyright

XenAPI is licensed under GNU LESSER GENERAL PUBLIC LICENSE Version 3.

The logo and some parts of the PHP Code is property of Contex.

Cadox8 updated the code and created the Java API.

Contex © 2012-2014

Cadox8 © 2018-2021

Donations

Building an Open Source Project is hard. You have to invert time and resources. 💸 💸

xenapi's People

Contributors

cadox8 avatar dependabot[bot] avatar fossabot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

xenapi's Issues

[Question] Usage?

Is there any example usage of this? Particularly, I am looking for some way to be able to get information such as thread content or conversation content?

[Question] Will this work for cloud flare?

I wanted to test the xenforo 2.0 branch to see if the authentication at least works. I'm unsure if it's the api that doesn't work or if it is cloudflare blocking it.

restdebugger_2018-06-21_09-48-15

Xenforo 2.0

hello, will there ever be a version for 2.0?
i rooted the forum and extras too based on these bees.
I'm stuck at xenforo 1.x version waiting for updates of these api for xenforo 2.0.
Will the new version come out?
I might as well pay.

XenForo for 2.X versions

This issue will keep the progress until the framework is released

Docs progress will, not appear on this issue

Global

  • Validators for all params (POST & GET & DELETE)

Alerts

  • GET alerts - Gets the API user's list of alerts
  • POST alerts - Sends an alert to the specified user. Only available to super user keys.
  • POST alerts/mark-all - Marks all of the API user's alerts as read or viewed. Must specify "read" or "viewed" parameters.
  • GET alerts/{id} - Gets information about the specified alert
  • POST alerts/{id}/mark - Marks the alert as viewed/read/unread. (Marking as unviewed is not supported.)

Attachments

  • GET attachments - Gets the attachments associated with the provided API attachment key. Only returns attachments that have not been associated with content.
  • POST attachments - Uploads an attachment. An API attachment key must be created first. Must be submitted using multipart/form-data encoding.
  • POST attachments/new-key - Creates a new attachment key, allowing attachments to be uploaded separately from the related content.
  • GET attachments/{id} - Gets information about the specified attachment.
  • DELETE attachments/{id} - Delete's the specified attachment.
  • GET attachments/{id}/data - Gets the data that makes up the specified attachment. The output is the raw binary data.
  • GET attachments/{id}/thumbnail - Gets the URL to the attachment's thumbnail, if it has one. URL returned via a 301 redirect.

Auth

  • POST auth - Tests a login and password for validity. Only available to super user keys. We strongly recommend the login and password parameters are passed into the request body rather than the query string.
  • POST auth/from-session - Looks up the active XenForo user based on session ID or remember cookie value. This can be used to help with seamless SSO with XF, assuming the session or remember cookies are available to your page. At least one of session_id and remember_cookie must be provided. Only available to super user keys.
  • POST auth/login-token - Generates a token that can automatically log into a specific XenForo user when the login URL is visited. If the visitor is already logged into a XenForo account, they will not be logged into the specified account. Only available to super user keys.

Conversations

  • POST conversation-messages - Replies to a conversation
  • GET conversation-messages/{id} - Gets the specified conversation message.
  • POST conversation-messages/{id} - Updates the specified conversation message.
  • POST conversation-messages/{id}/react - Reacts to the specified conversation message
  • GET conversations - Gets the API user's list of conversations.
  • POST conversations - Creates a conversation
  • GET conversations/{id} - Gets information about the specified conversation.
  • POST conversations/{id} - Updates the specified conversation
  • DELETE conversations/{id} - Deletes the specified conversation from the API user's list. Does not `DELETE the conversation for other receivers.
  • POST conversations/{id}/invite - Invites the specified users to this conversation.
  • POST conversations/{id}/mark-read - Marks the conversation as read up until the specified time. This cannot move the
  • POST conversations/{id}/mark-unread - Marks a conversation as unread. This will mark all messages in the conversation as unread.
  • GET conversations/{id}/messages - Gets a page of messages in the specified conversation.
  • POST conversations/{id}/star - Sets the star status of the specified conversation

Forums

  • GET forums/{id} - Gets information about the specified forum
  • POST forums/{id}/mark-read - Marks the forum as read up until the specified time. This cannot mark a forum as unread or
  • GET forums/{id}/threads - Gets a page of threads from the specified forum.

Index

  • GET index - Gets general information about the site and the API

Me

  • GET me - Gets information about the current API user
  • POST me - Updates information about the current user
  • POST me/avatar - Updates the current user's avatar
  • DELETE me/avatar - Deletes the current user's avatar
  • POST me/email - Updates the current user's email address
  • POST me/password - Updates the current user's password

Nodes

  • GET nodes - Gets the node tree.
  • POST nodes - Creates a new node
  • GET nodes/flattened - Gets a flattened node tree. Traversing this will return a list of nodes in the expected order.
  • GET nodes/{id} - Gets information about the specified node
  • POST nodes/{id} - Updates the specified node
  • DELETE nodes/{id} - Deletes the specified node

Posts

  • POST posts - Adds a new reply to a thread.
  • GET posts/{id} - Gets information about the specified post
  • POST posts/{id} - Updates the specified post
  • DELETE posts/{id} - Deletes the specified post. Default to soft deletion.
  • POST posts/{id}/mark-solution - Toggle the specified post as the solution to its containing thread. If a post is marked as a solution when another is already marked, the existing solution will be unmarked.
  • POST posts/{id}/react - Reacts to the specified post
  • POST posts/{id}/vote - Votes on the specified post (if applicable)

Profile Posts

  • POST profile-posts-comments - Creates a new profile post comment.
  • GET profile-post-comments/{id} - Gets information about the specified profile post comment.
  • POST profile-post-comments/{id} - Updates the specified profile post comment.
  • DELETE profile-post-comments/{id} - Deletes the specified profile post comment. Default to soft deletion.
  • POST profile-post-comments/{id}/react - Reacts to the specified profile post comment
  • POST profile-posts - Creates a new profile post.
  • GET profile-posts/{id} - Gets information about the specified profile post.
  • POST profile-posts/{id} - Updates the specified profile post.
  • DELETE profile-posts/{id} - Deletes the specified profile post. Default to soft deletion.
  • GET profile-posts/{id}/comments Gets a page of comments on the specified profile post.
  • POST profile-posts/{id}/react - Reacts to the specified profile post

Search Forums

  • GET search-forums/{id} - Gets information about the specified search forum
  • GET search-forums/{id}/threads Gets a page of threads from the specified search forum.

Stats

  • GET stats - Gets site statistics and general activity information

Threads

  • GET threads - Gets a list of threads
  • POST threads - Creates a thread. Thread type data can be set using additional input specific to the tar`GET thread type.
  • GET threads/{id} - Gets information about the specified thread.
  • POST threads/{id} - Updates the specified thread
  • DELETE threads/{id} - Deletes the specified thread. Default to soft deletion.
  • POST threads/{id}/change-type - Converts a thread to the specified type. Additional thread type data can be set using input specific to the new thread type.
  • POST threads/{id}/mark-read - Marks the thread as read up until the specified time. This cannot mark a thread as unread or
  • POST threads/{id}/move - Moves the specified thread to a different forum. Only simple title/prefix updates are supported at the same time
  • GET threads/{id}/posts - Gets a page of posts in the specified conversation.
  • POST threads/{id}/vote - Votes on the specified thread (if applicable)

Users

  • GET users - Gets a list of users (alphabetically)
  • POST users - Creates a user.
  • GET users/find-email - Finds users by their email. Only available to admin users (or when bypassing permissions).
  • GET users/find-name - Finds users by a prefix of their user name.
  • GET users/{id} - Gets information about the specified user.
  • POST users/{id} - Updates an existing user.
  • DELETE users/{id} - Deletes the specified user
  • POST users/{id}/avatar - Updates the specified user's avatar
  • DELETE users/{id}/avatar - Deletes the specified user's avatar
  • GET users/{id}/profile-posts - Gets a page of profile posts on the specified user's profile.

Media

  • GET media - [Incomplete]
  • POST media - [Incomplete]
  • GET media/{id} - [Incomplete]
  • POST media/{id} - [Incomplete]
  • DELETE media/{id} - [Incomplete]
  • GET media/{id}/comments - [Incomplete]
  • GET media/{id}/data - [Incomplete]
  • POST media/{id}/react - [Incomplete]

Media Albums

  • GET media-albums - [Incomplete]
  • POST media-albums - [Incomplete]
  • GET media-albums/{id} - [Incomplete]
  • POST media-albums/{id} - [Incomplete]
  • DELETE media-albums/{id} - [Incomplete]
  • GET media-albums/{id}/comments - [Incomplete]
  • GET media-albums/{id}/media - [Incomplete]
  • POST media-albums/{id}/react - [Incomplete]

Media Categories

  • GET media-categories - [Incomplete]
  • POST media-categories - [Incomplete]
  • GET media-categories/flattened - [Incomplete]
  • GET media-categories/{id} - [Incomplete]
  • POST media-categories/{id} - [Incomplete]
  • DELETE media-categories/{id} - Deletes the specified category
  • GET media-categories/{id}/content - Gets a page of content from the specified category.

Media Comments

  • GET media-comments - [Incomplete]
  • POST media-comments - [Incomplete]
  • GET media-comments/{id} - [Incomplete]
  • POST media-comments/{id} - [Incomplete]
  • DELETE media-comments/{id} - [Incomplete]
  • POST media-comments/{id}/react - [Incomplete]

OAuth2

  • POST oauth2/revoke - Revokes an access token or refresh token.
  • GET oauth2/token - [Incomplete]
  • POST oauth2/token - [Incomplete]
  • GET oembed - [Incomplete]

Resource Categories

  • GET resource-categories - [Incomplete]
  • POST resource-categories - [Incomplete]
  • GET resource-categories/flattened - [Incomplete]
  • GET resource-categories/{id} - [Incomplete]
  • POST resource-categories/{id} - [Incomplete]
  • DELETE resource-categories/{id} - Deletes the specified category
  • GET resource-categories/{id}/resources - Gets a page of resources from the specified category.

Resource Reviews

  • GET resource-reviews - [Incomplete]
  • POST resource-reviews - [Incomplete]
  • GET resource-reviews/{id} - [Incomplete]
  • DELETE resource-reviews/{id} - [Incomplete]
  • POST resource-reviews/{id}/author-reply - [Incomplete]
  • DELETE resource-reviews/{id}/author-reply - [Incomplete]

Resource Updates

  • POST resource-updates - [Incomplete]
  • GET resource-updates/{id} - [Incomplete]
  • POST resource-updates/{id} - [Incomplete]
  • DELETE resource-updates/{id} - [Incomplete]

Resource Versions

  • POST resource-versions - [Incomplete]
  • GET resource-versions/{id} - [Incomplete]
  • DELETE resource-versions/{id} - [Incomplete]
  • GET resource-versions/{id}/download - [Incomplete]

Resources

  • GET resources - [Incomplete]
  • POST resources - [Incomplete]
  • GET resources/{id} - [Incomplete]
  • POST resources/{id} - [Incomplete]
  • DELETE resources/{id} - [Incomplete]
  • GET resources/{id}/reviews - [Incomplete]
  • GET resources/{id}/updates - [Incomplete]
  • GET resources/{id}/versions - [Incomplete]

GET_ALERTS parse error?

Describe the bug
There is an error getting an API reply in GET_ALERTS.

To Reproduce

public static void handleTickets() {
        Request r = RequestBuilder.newRequest(RequestType.GET_ALERTS)
                .addParam(RequestParam.VALUE_STRING, "Information")
                .addParam(RequestParam.TYPE_STRING, "fetchAll")
                .createRequest();

        System.out.println(r.getURL(XenAPI.getInstance()));

        XenAPI.getInstance().getReply(r, (Callback<AuthenticateReply>) (failCause, result) -> {
            try {
                if (failCause != null) {
                    failCause.printStackTrace();
                } else {
                    Logs.log(result.toString());
                }
            } catch (ArgsErrorException e) {
                e.printStackTrace();
            }
        });
    }

Expected behavior
If I print the request url, and paste it in my browser, that seems to work fine so I know didn't make any request errors. It appears there is some issue here during the parsing of that result.

Screenshots
image

Unable to Find XenAPI Object

While in my Java IDE (Intellij), when I try to type "XenAPI" nothing comes up as if the package cannot be found. I have added the jar as a dependency to my project but cant seem to access anything from XenAPI. Please Advise.

Xenforo 2

I see in your TODO xenforo 2 is planned. Is there any possible date when this might be added?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.