I want to use API
Here is the documentation
https://dirtymarkup.com/docs
How do i use it via automagic premium?
How to use api via http request
Moderator: Martin
Re: How to use api via http request
Hi,
You can use an action HTTP Request:
URL: https://dirtymarkup.com/api/html
Request Method: POST
Content Type: application/x-www-form-urlencoded
Form Field List: code=<html>test,indent=2
Store response in variable
The response seems to be a JSON so you can extract the formatted text using an action Script:
Please note that the form field list needs to be properly formatted in case the code contains commas and other special characters. You can prepare the form field list in a script by populating a variable list and then use {list,listformat,comma} to create the form field list. Example script:
Regards,
Martin
You can use an action HTTP Request:
URL: https://dirtymarkup.com/api/html
Request Method: POST
Content Type: application/x-www-form-urlencoded
Form Field List: code=<html>test,indent=2
Store response in variable
The response seems to be a JSON so you can extract the formatted text using an action Script:
Code: Select all
formatted_text=fromJSON(response)["clean"];
Code: Select all
list = newList();
addElement(list, "code="+your_code);
addElement(list, "line-length=120");
Martin