-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
146 lines (117 loc) · 4.43 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
FORMAT: 1A
HOST: http://api.utilify.io/
# utilify
API to discover utility bills information.
## Providers [/providers]
List of providers that Utilify can extract information
### Get a list of available Providers [GET]
Retrieve list
+ Response 200 (application/json)
+ Body
[
{
"id": "1234",
"name": "eon",
"url": "https://www.eonenergy.com",
"logoUrl": "https://somecontentresourcehost.com/imageurl",
"status": "online",
"fields": [
{
"name": "username",
"type": "string",
"caption": "Username",
"description": "email address or account number"
},
{
"name": "password",
"type": "string",
"caption": "Password",
"description": ""
]
},
{
"id": "2345",
"name": "scottishpower",
"url": "https://www.scottishpower.co.uk",
"logoUrl": "https://somecontentresourcehost.com/imageurl",
"status": "offline",
"fields": [
{
"name": "username",
"type": "string",
"caption": "Username",
"description": "email address or account number"
},
{
"name": "password",
"type": "string",
"caption": "Password",
"description": ""
]
}
]
## Utility [/utility]
Utility contains account details extracted from provider's website
### Scrape provider for utility details [POST]
Posting user's login details for specific providers initiates data extraction.
metadata: Key-value store of custom data. Up to 3 keys are permitted,
with key names up to 50 characters and values up to 500 characters.
+ Request (application/json)
+ Body
{
"providerId": "someproviderid"
"fields":{
"username": "joedoe",
"password": "superduperlongdifficultpassword"
},
"webhookUrl": "https://myspecialdomain.com/webhookurl",
"metadata": []
}
+ Response 202 (application/json)
+ Headers
Location: /utility/e10ac2cd-f9e9-4215-9ee1-feac80ba4f92
+ Body
{
"id": "e10ac2cd-f9e9-4215-9ee1-feac80ba4f92",
"createdAt": "2016-04-23T18:25:43.511Z",
"link": "https://utlify.io/utlity/e10ac2cd-f9e9-4215-9ee1-feac80ba4f92"
}
### Get utility details [GET /utility/{id}]
Retrieve utility account details extracted from provider's website.
+ Parameters
+ id (uuid) - Id reference for the utility details
+ Response 200 (application/json)
+ Body
{
"providerId": "someOtherProviderId",
"customerName": {
"firstName": "Nope",
"middleName": "NotMe",
"lastName": "Noone"
},
"customerAddress": {
"line1": "6 Nowhere Close",
"line2": "",
"line3": "",
"line4": "",
"city": "Nowhere",
"county": "NowhereShire",
"postcode": "N00 0PE",
"country": "UK"
},
"accountReference": "someUniqueAccountReference",
"documentLink": "https://utilify.io/utility/file/someUniqueDocumentId",
"lastPaymentAt": "2016-01-01T12:00:00.000Z"
}
## Account [/account]
Account holds information about user account with the provider
### Account balance [GET /account/balance]
Retrieve account balance
+ Response 200 (application/json)
+ Body
{
"money": {
"amount": 100.50,
"currency": "GBP"
}
}