API Guide

You can use an RESTful API to upload publications in the case you need to upload multiple of them at the same time. You can also perform an advanced search and get publications information. Given that for uploading files and exploring publications you have to be authenticated, to use the API you have to use the token you can find in the settings page. The way of using it is adding the header "Authorization: Token {token}" to the request.

Upload images

In order to upload a publication using the API, the request has to be sent to the url /api/new_publication/ using the POST method. It has to be a multipart request with two parts.

Search publications

To performa a search through the publications a request has to be sent to the url /api/search/ containing the fields to be used to filter the images. The informations has to be JSON formatted and the request must have the the Content-Type value application/json. Here is an example:
    
        {
            'result_type': 'Experimental',
            'contact': True,
            'molecule_cid': 496,
            'additional_info': 'hot',
            'params': [
                {
                    'name': 'Tip',
                    'value': 'Traditional',
                    'detail': 'Other',
                    'user_input': 'Lerasium'
                }
            ]
        }
    

The application will filter the publications wich match the given exactly the given values, save for the user_input and additional_info, which will search for publications that contain its values.

The results will be paginated, and the links for the next and previous page will be included in the response. For each image result, there will be provided the link to get the thumbnail and original images generated from the file.