Skip to content

Commit

Permalink
Add a section in README to document the HTTP REST API. See #123
Browse files Browse the repository at this point in the history
  • Loading branch information
katauber committed Sep 4, 2023
1 parent 3cc8cfc commit eab04f9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,15 @@ lein test
Run workflows on the web server, passing `data`, `flux`, and `fix` as GET-Parameter:

[http://localhost:3000/process?data='1'{'a': '5', 'z': 10}&flux=as-lines|decode-formeta|fix|encode-formeta(style="multiline")&fix=map(a,b) map(_else)](http://localhost:3000/process?data=%271%27{%27a%27:%20%275%27,%20%27z%27:%2010}&flux=as-lines|decode-formeta|fix|encode-formeta(style=%22multiline%22)&fix=map(a,c)%20map(_else))

## Use Metafacture Playground API

Beside using the Metafacture Playground webapplication it's possible to access workflow results via API.

## API
Beside the web application the Metafacture Playground provides a HTTP REST API to process workflows.To process a workflow you need to provide the workflow information as JSON parameters in your POST request.

```
curl -X POST https://test.metafacture.org/playground/process -H 'Content-Type: application/json' -d '{"data":"1{a: Faust, b {n: Goethe, v: JW}, c: Weimar}\n2{a: Räuber, b {n: Schiller, v: F}, c: Weimar}","flux":"inputFile\n|open-file\n|as-lines\n|decode-formeta\n|fix(transformationFile)\n|encode-xml(rootTag=\"collection\")\n|print\n;","transformation":"move_field(_id, id)\nmove_field(a, title)\npaste(author, b.v, b.n, \"~aus\", c)\nretain(id, title,
author)\n"}'
```

0 comments on commit eab04f9

Please sign in to comment.