The entire API lives under the URL /services/rest, for example http://www.mediamatic.net/services/rest/. Despite its name the API is more RPC (remote procedure call) than REST (representational state transfer) in style, with the same URL used for all calls and the API method specified via the required query parameter 'method'. For example, http://www.mediamatic.net/services/rest/?method=anymeta.user.info&format=json will give information on the logged in user in the JSON format. Some methods can be used via HTTP GET requests without authentication, namely those which retrieve public information, while those that deal with more private information must be signed using OAuth so that anyMeta can verify that the client requesting the data has permission to get it. All methods which create or modify data must be requested via the POST method and signed with OAuth.
If you visit in your browser the plain /services/rest URL without any query parameters you will see the automatically generated documentation for all API method enabled on the anyMeta server. Each entry has a short description of its purpose, a list of its parameters, an example response, possible error codes, and an example request. While the information listed is rarely wrong, you may find that many request parameter listings are not always very useful. Likewise notice that responses to various API methods may use different keys in their response objects to refer to the same thing. For instance, sometimes a Thing id is called 'id', something 'thing_id', othertimes even 'thg_id' or 'rsc_id'. We are aware of these inconsistencies and are working to fix them.
There are a lot of method listed on the page and it can be quick overwhelming. Below I have listed the most useful methods by category. As a rule of thumb there are get and set (or add and update) methods for most things, and some categories have search methods. For searching you should particularly pay attention to the structured query methods query.execute and query.search (added in one of the latest versions of anyMeta) and full text query methods like anymeta.search.live and anymeta.search.textmatch.
Thing Methods
- anymeta.attachment.create - With this method you can create a Thing of kind ATTACHMENT while uploading its binary data. The mime and title parameters are quite straight-forward, while data is a Base 64 encoded string of the binary data and connect is a list of dictionaries containing the necessary data to create edges. For example: [{'subject': '1', 'predicate': 'TAKEN_AT', 'object': 'SELF'}]. This would indicate that the ATTACHMENT being uploaded was taken at the LOCATION with the thing_id 1.
- anymeta.tags.add - Currently you can only add one tag at a time, despite was the /services/rest documentation suggests.
- anymeta.thing.discover - In the absence of an anymeta.thing.get method, this method is a great way to get the basic details of the Thing record. It takes a resource URI, which you can easily assemble from a Thing id or symbolic name so like: http://the.anymeta.site//_or_symbolic_name.
- anymeta.thing.duplicate
- anymeta.thing.insert - The data dictionary the method takes has a lot of options, with the most important ones being the nested dictionaries of 'text' and 'coverage'. 'text' can contain the various text of the Thing, such as the title and body, while 'coverage' can be used to indicate when or where a Thing takes place. This applies not only to events but also people's lives. By default Things created by the method are marked as unpublished, so remember to set 'pubstate' to '1' if you want others to be able to see the Thing. A data dictionary might look like so: {'kind': 'LOCATION', 'text': {'title': location, 'language': 'nl'}, 'address': {'city': city, 'country': countryCode}, 'coverage': {'date_start': datetime, 'accuracy': 'i'}, 'pubstate': 1}.
- anymeta.thing.makeAuthoritative
- anymeta.thing.makeNonAuthoritative
- anymeta.thing.update - This method uses the same data dictionary format as the insert method.anymeta.things.delete - If the followup parameter is used then all references to the deleted Thing will be updated to refer to the followup Thing. Thus, thus duplicate Things can be deleted with this method without breaking references, such as for duplicate tags.anymeta.trust.set - This method sets the access control rules for the given Thing.
(Meta)data Methods
- anymeta.metadata.addKeyword
- anymeta.metadata.listKeyword
- anymeta.predicates.delete
- anymeta.predicates.get – This method is misnamed, as it gets a property of a Thing, not a Predicate of an Edge.
- anymeta.predicates.set – This method is misnamed, as it gets a property of a Thing, not a Predicate of an Edge.
- anymeta.props.get
- anymeta.props.set
User Methods
- anymeta.memberships.add
- anymeta.memberships.remove
- anymeta.messages.getInfo
- anymeta.messages.getReceivedList
- anymeta.messages.getSentList
- anymeta.messages.remove
- anymeta.messages.send
- anymeta.notifications.get
- anymeta.user.check
- anymeta.user.info
- identity.add
- identity.add.uri
- identity.delete
- identity.identify
- identity.list
- status.set
Edge Methods
- anymeta.additions.add
- anymeta.additions.remove
- anymeta.annotates.add
- anymeta.annotates.edit
- anymeta.annotates.getInfo
- anymeta.annotates.remove
- anymeta.edge.add
- anymeta.edge.addList
- anymeta.edge.attribute.get
- anymeta.edge.attribute.set
- anymeta.edge.order
- anymeta.edge.remove
Query Methods
- anymeta.search.live
- anymeta.search.textmatch
- anymeta.thing.discover
- identity.search
- identity.search.uri
- oauth.discover
Testing Methods
- anymeta.test.echo
- anymeta.test.error
- anymeta.test.login
- anymeta.thing.dump - This method will return all data about a Thing, include all its Edges. Watch out, if you call the method on an ATTACHMENT Thing the base64 encoded binary data will be included in the response! The method is provided by the ThingDump module, so it is . However, the method is quite useful and the module is included with anyMeta by default, so you may want to ask your anyMeta administrator to enable it.
Administration Methods
- accesscontrol.user.thing.add
- accesscontrol.user.thing.remove
- anymeta.queue.run
- anymeta.error.log
- anymeta.type.add
- anymeta.type.addrem
- anymeta.type.remove
- anymeta.user.create
- authentication.user.change.password
- authentication.user.create.onetimelogon
- authentication.user.create.person
- authentication.user.exists
- authentication.user.get.pref
- authentication.user.logon
- authentication.user.register
- authentication.user.reset.password
- authentication.user.set.password
- authentication.user.set.pref
- authentication.user.verify.sha1openid.whitelist.get