ammaraziz / fuzee Goto Github PK
View Code? Open in Web Editor NEWInterface to Fuzee API
License: MIT License
Interface to Fuzee API
License: MIT License
Provide functionality to download pdf reports sent via automated email.
Burger menu > History > Search Emails
Two step process, first send a POST
to get a list emails per report followed by a GET
request to download a specific report.
POST
requesthttps://my.fuzee.com/ajax
cookies = FUZEESTAYLOGGEDIN=YES; FUZEEUSERAUTH=MXwxNjYxOTIxMTAxfG9IdjhwV29sZmdPbkMxa1Q%3D
request body = c=table&s=emailHistory&from=X&to=Y&type=
X/Y = date in YYYY-MM-DD
format
POST
Response:A json with two fields.
types
contains a list of table names and their ID.Object { table: "TABLEID", "ucase(left(`table`,1))": "Q", name: "Storage Listing" }
TABLEIDs need to be stored in a named list to access by name.
data
, which contains a list objectstype: "Email"
id: "UNIQID"
table: "Report Name"
field: ""
data: "CentreName"
created: "25/08/2022 16:34"
user: "Person Name"
sort: "2022-08-25 16:34:16"
uid: ""
to: "email"
id
is needed as the unique identifier to download the email.
GET
request to downloadhttps://my.fuzee.com/ajax?c=file&s=get&file_code=UNIQID
File is downloaded as an eml
, which is plain text mime file. File needs to be read line by line until the attachment.
Attachment head:
--b1_946c9f3e62087e2f21e9b761e448c41851da4fefa86a7aa0c1d6fc8435c652ad
Content-Type: application/pdf; name="NAME"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="NAME"
< pdf encoded as base64 >
--b1_946c9f3e62087e2f21e9b761e448c41851da4fefa86a7aa0c1d6fc8435c652ad
R code to convert to pdf:
txt = readLines("test.txt")
a = base64enc::base64decode(txt)
writeBin(a, "test.pdf")
txt
looks like this:
[1] "JVBERi0xLjMKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL1Jlc291cmNlcyAy"
[2] "IDAgUgovQ29udGVudHMgNCAwIFI+PgplbmRvYmoKNCAwIG9iago8PC9GaWx0ZXIgL0ZsYXRlRGVj"
[3] "b2RlIC9MZW5ndGggMjQzMT4+CnN0cmVhbQp4nM2bT3PbthbF9/kUWLbTBCbA/7u6cdu4k0nznj3t"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.