# REST API Endpoints

In addition to the Process Endpoint designed for ingesting data into the Writer, there is a selection of built-in exposed endpoints for you to call.

| **API**              | **HTTP Request**                 | **URL Template**                                                               | **Description**                                                                                                      |
| -------------------- | -------------------------------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| Process              | GET                              | `/process?inputRdfURL=<input-rdf-file-url>`                                    | Tells the Writer to ingest the RDF file located at the specified URL location                                        |
| Config               | GET                              | `/config`                                                                      | Displays all Writer configuration as JSON                                                                            |
| GET                  | `/config?paths=<config-options>` | Displays all Writer configuration specified in param as a comma-separated list |                                                                                                                      |
| Check Connection     | GET                              | `/checkConnection`                                                             | Tests whether the Writer can establish a connection with the specific Knowledge Graph credentials                    |
| Update Config        | PUT                              | `/updateConfig?configEntry=<config-entry>&configValue=<config-value>`          | Update configuration options on a running Writer                                                                     |
| Upload Config Backup | PUT                              | `/uploadConfigBackup`                                                          | Uploads the current configuration to the specified config backup location so that it can be restored at a later date |
| License              | GET                              | `/license`                                                                     | Displays license information                                                                                         |
| Restart Kafka        | GET                              | `/restartKafka`                                                                | Turns the Writer’s Kafka connection on or off depending on its current state.                                        |

&#x20;

### Config <a href="#config" id="config"></a>

The config endpoint is a GET request that allows you to view the configuration settings of a running Writer. By sending `GET http://<writer-ip>:<writer-port>/config` (for example `http://127.0.0.1:8080/config`), you will receive the entire configuration represented as a JSON object, as seen in this small snippet below.

```
 {
    "version": "2.1.0.0",
    "applicationName": "Graph-Writer",
    "friendlyName": "Graph-Writer",
    "graphBuildWriterConfig": {
        "provenance": {
            "recordProvo": false
        }..........

```

### Update Config <a href="#update-config" id="update-config"></a>

#### PUT `/updateConfig` <a href="#put-updateconfig" id="put-updateconfig"></a>

The configuration on running Writer can now be edited without having to restart. This is done through the update config endpoint. For example, by running the following `/updateConfig?configEntry=friendlyName&configValue=GraphBuilder` we have changed the friendly name of the Writer to GraphBuilder. To see a list of the configuration entry names, consult the Graph Writer [Configurable Options](/EGeX4aTAJLlpg9Hh8kfl/graph-writer/all-configuration-options.md).

### License <a href="#license" id="license"></a>

The license endpoint is a GET request that allows you to view information about your license key that is in use on a running Transformer or Writer. By sending `GET http://<writer-ip>:<writer-port>/license` (for example: `http://127.0.0.1:8080/license`), you will receive a JSON response containing the following values.

```
{
    "license": "# graphbuild License (id: xxx) xxxxxxxx",
    "licenseInformation": {
        "registeredTo": "Name - Company - email@example.com",
        "expires": "Thu Dec 31 00:01:00 GMT 2020 - (xxx days to go)",
        "productName": "graphbuild"
    },
    "validationStatus": "LICENSE_VALID"
}
```

### Process <a href="#process" id="process"></a>

As previously [outlined](/EGeX4aTAJLlpg9Hh8kfl/graph-writer/ingesting-graph-data-rdf-and-csv.md), using the process endpoint is one way of triggering the Writer to ingest your source data. When an execution of the Writer fails after being triggered in this way, the response will be a status `400 Bad Request` and contain a response message similar to that sent to the dead letter queue.

```
{
    "name": "Graph-Writer",
	"time": "2023-03-09T11:41:28.374",
	"type": "Graph-Writer",
	"error": "Record '/var/local/basic-rdf.xyz' could not be processed due to: u.c.d.w.e.GraphWriterExecutionException: Input file is of an invalid file type: (.xyz) - Expected nq.",
	"version": "2.1.0.0",
	"entity": "/var/local/basic-rdf.xyz"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.graph.build/EGeX4aTAJLlpg9Hh8kfl/graph-writer/rest-api-endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
