Files and Libraries

Java JSON Client Library

Created September 30, 2024

The Java client-side library is used to provide the set of Java objects that can be serialized to/from JSON using Jackson. This is useful for accessing the JSON REST endpoints that are published by this application.

Resources Example (Raw JAXB)
java.net.URL url = new java.net.URL(baseURL + "/api/v2/createAdminUser");
ObjectMapper mapper = new ObjectMapper();
java.net.URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.connect();

mapper.writeValue(connection.getOutputStream(), object);
StringPayload result = (StringPayload) mapper.readValue( connection.getInputStream(), StringPayload.class );
//handle the result as needed...
    
Resources Example (Jersey client)
javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient();

StringPayload result = client.target(baseUrl + "/api/v2/createAdminUser")
  .post(javax.ws.rs.client.Entity.entity(object, "application/json"), StringPayload.class);

//handle the result as needed...
    

Files
name size description
tungsten-api-server-json-client.jar 9.61K The binaries for the Java JSON client library.
tungsten-api-server-json-client-json-sources.jar 7.84K The sources for the Java JSON client library.

PHP JSON Client Library

Created September 30, 2024

The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON. This is useful for accessing the resources that are published by this application, but only those that produce a JSON representation of their resources (content type "application/json").

This library requires the json_encode function which was included in PHP versions 5.2.0+.

PHP JSON Example
//read the resource in JSON:
$json = ...;

//read the json as an array.
$parsed = json_decode($json, true);

//read the json array as the object
$result = new Object($parsed);

//open a writer for the json
$json = $result->toJson();
    

Files
name size description
tungsten-api-server-php-json-client-php.zip 2.84K

The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON. This is useful for accessing the resources that are published by this application, but only those that produce a JSON representation of their resources (content type "application/json").

This library requires the json_encode function which was included in PHP versions 5.2.0+.

PHP JSON Example
//read the resource in JSON:
$json = ...;

//read the json as an array.
$parsed = json_decode($json, true);

//read the json array as the object
$result = new Object($parsed);

//open a writer for the json
$json = $result->toJson();