Access

Contents

Access

By default API access is disabled. You can enable it in Settings -> API Settings.


Token-based authentication

Every API request must include the HTTP header X-tinyPM-token, Here is an example of a request:

GET /tinypm/api/project/1 HTTP/1.1
Host: localhost:8080
Accept: */*
X-tinyPM-token: 8709725e52ecec50e4ece9e8f718c355

It is also possible to use token as a request parameter http://host:port/uri?token=, but we don't recommend it for production use (You may probably benefit from it only when testing out GET request directly from the browser, see Helpful tools for more on testing).

The token:

  • is bound to your tinyPM instance and not to any particular user
  • never expires
  • can be found in Settings -> API Settings
  • is a long hash like 8709725e52ecec50e4ece9e8f718c355
  • works only when the API is enabled
  • can be regenerated if needed in Settings -> API Settings -> reset token



If your tinyPM runs on JRE version 1.6.0_1 to 1.6.0_3 ...

You might encounter JAX-B incompability exception:

java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file: tinypm/war/WEB-INF/lib/jaxb-impl-2.1.10.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)

We recommend you upgrade JVM. If this isn't possible in your environment, include the following jars (you can find them in your tinypm installation tinypm/war/WEB-INF/lib/):

  • jaxb-api-2.1.jar
  • jaxb-impl-2.1.10.jar

in the Tomcat "endorsed" directory, pointed by the JVM option -Djava.endorsed.dirs. Mostly that will be:

JAVA_OPTS="-Djava.endorsed.dirs=$CATALINA_HOME/common/endorsed ... (Tomcat 5.5)
JAVA_OPTS="-Djava.endorsed.dirs=$CATALINA_HOME/endorsed ... (Tomcat 6)

Add JVM option and create the directory if not present. Tomcat restart is required to have jars reloaded (classes will be loaded by the bootstrap classloader http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html )

? If this documentation doesn't solve your problem or has left you with any questions, please don't hesitate to contact us at support@tinypm.com
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.