forked from aWhereAPI/API-Postman-Collections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aWhereAPIs.json.postman_collection
631 lines (631 loc) · 24.7 KB
/
aWhereAPIs.json.postman_collection
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
{
"info": {
"_postman_id": "bcaf3867-fe08-48a9-9e39-9180293e33c2",
"name": "aWhere API Platform",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Agronomics",
"description": "",
"item": [
{
"name": "Agronomic Values & Accumulations",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/agronomics/fields/field1/agronomicvalues/2015-08-01,2015-08-03",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"agronomics",
"fields",
"field1",
"agronomicvalues",
"2015-08-01,2015-08-03"
]
},
"description": "####Request\nThis API call gets calculated agronomics and accumulations at a field location. \n\nThe URL used here will get the values for a certain range of days. This is a very flexible API and so you're encouraged to review the [Agronomics Documentation](http://developer.awhere.com/api/reference/agronomics/values).\n\n_Tip: Remember to use a field ID that exists in your account. By default, this collection uses a default field ID of 'field1'_\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Agronomic Norms",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/agronomics/fields/field1/agronomicnorms/08-01,08-03/years/2010,2014",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"agronomics",
"fields",
"field1",
"agronomicnorms",
"08-01,08-03",
"years",
"2010,2014"
]
},
"description": "####Request\nThis API call gets the long term averages for agronomic values and accumulations at a field location. \n\nThe URL used here will get the values for a certain range of days over a certain range of years. This is a very flexible API and so you're encouraged to review the [Agronomics Documentation](http://developer.awhere.com/api/reference/agronomics/norms).\n\n_Tip: Remember to use a field ID that exists in your account. By default, this collection uses a default field ID of 'field1'_\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
}
]
},
{
"name": "Fields & Plantings",
"description": "",
"item": [
{
"name": "Get Fields List",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/fields",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"fields"
]
},
"description": "####Request\nThis API call retrieves the list of fields in your account. \n\n[Get Fields Documentation](http://developer.awhere.com/api/reference/fields/get-fields)\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Create a Field",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"id\": \"field1\",\n \"name\":\"My First Field\",\n \"farmId\":\"farm1\",\n \"acres\":100,\n \"centerPoint\":{\n \"latitude\":39.8282,\n \"longitude\":-98.5795\n }\n}"
},
"url": {
"raw": "https://api.awhere.com/v2/fields",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"fields"
]
},
"description": "####Request\nThis API call creates a field location in your account. Be sure to change the body payload. \n\n[Create Fields Documentation](http://developer.awhere.com/api/reference/fields/create-field)\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Get a Single Field by ID",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/fields/field1",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"fields",
"field1"
]
},
"description": "####Request\nThis API call retrieves a single field by ID.\n\n[Get Fields Documentation](http://developer.awhere.com/api/reference/fields/get-fields)\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Update Field",
"request": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "[\n { \"op\":\"test\",\n \"path\":\"/farmid\",\n \"value\":\"farm1\"\n },\n {\n \"op\":\"replace\",\n \"path\":\"/farmid\",\n \"value\":\"Farm-100\"\n }\n]"
},
"url": {
"raw": "https://api.awhere.com/v2/fields/field1",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"fields",
"field1"
]
},
"description": "####Request\nThis API call shows how to update the farm ID on a field location. You can also change the name.\n\n[Update Field Documentation](http://developer.awhere.com/api/reference/fields/update-field)\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Get Plantings List for a Field",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/agronomics/fields/field1/plantings",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"agronomics",
"fields",
"field1",
"plantings"
]
},
"description": "####Request\nThis API call retrieves the list of plantings for a specific field in your account. \n\n[Get Plantings Documentation](http://developer.awhere.com/api/reference/plantings/get-plantings)\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Create a Planting",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"crop\":\"corn-2300-gdd\",\n \"plantingDate\":\"2015-07-01\",\n \"projections\":{\n \"yield\":{\n \"amount\":500,\n \"units\":\"bushels\",\n },\n \"harvestDate\":\"2015-08-30\"\n },\n \"yield\":null,\n \"harvestDate\":null\n}"
},
"url": {
"raw": "https://api.awhere.com/v2/agronomics/fields/field1/plantings",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"agronomics",
"fields",
"field1",
"plantings"
]
},
"description": "####Request\nThis API call creates a planting for a specific field in your account. \n\n__Note:__ You should at least change the dates in the request body.\n\n[Create Planting Documentation](http://developer.awhere.com/api/reference/plantings/create)\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Update Part of a Planting",
"request": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "[\n { \"op\":\"replace\",\n \"path\":\"/projections/yield/amount\",\n \"value\":400\n },\n {\n \"op\":\"replace\",\n \"path\":\"/projections/harvestdate\",\n \"value\":\"2015-09-15\"\n }\n]"
},
"url": {
"raw": "https://api.awhere.com/v2/agronomics/fields/field1/plantings/current",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"agronomics",
"fields",
"field1",
"plantings",
"current"
]
},
"description": "####Request\nThis API call shows how to update only a couple of fields in a planting instead of having to update the entire object.\n\n__Note:__ You probably what to change the date in the request body.\n\n[Update Planting Documentation](http://developer.awhere.com/api/reference/plantings/update)\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
}
]
},
{
"name": "Models",
"description": "",
"item": [
{
"name": "Get Crops",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/agronomics/crops",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"agronomics",
"crops"
]
},
"description": "####Request\nThis API call returns the list of currently available crops in the aWhere platform.\n\n[Crops Documentation](http://developer.awhere.com/api/reference/crops).\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Get Models",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/agronomics/models",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"agronomics",
"models"
]
},
"description": "####Request\nThis API call returns the list of currently available models in the aWhere platform.\n\n[Crops Documentation](http://developer.awhere.com/api/reference/models/get-models).\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Get Model Details",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/agronomics/models/BarleyGenericMSU/details",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"agronomics",
"models",
"BarleyGenericMSU",
"details"
]
},
"description": "####Request\nThis API call returns the details about a particular model. Currently, growth stage models are available via the API, so the details are a list of the possible stages with GDD threshold information. \n\n[Model Details Documentation](http://developer.awhere.com/api/reference/models/details).\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Get Model Results",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/agronomics/fields/field1/models/BarleyGenericMSU/results",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"agronomics",
"fields",
"field1",
"models",
"BarleyGenericMSU",
"results"
]
},
"description": "####Request\nThis API call returns the current results of a model based on the data provided for the identified field location. \n\n[Model Results Documentation](http://developer.awhere.com/api/reference/models/results).\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
}
]
},
{
"name": "Weather",
"description": "",
"item": [
{
"name": "Daily Observations",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/weather/fields/field1/observations",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"weather",
"fields",
"field1",
"observations"
]
},
"description": "####Request\nThis API call gets the weather at a field location.\n\nThe default URL will get the last seven days of actual weather observations. You can add dates to the end of the URL to get the weather for a specific range of days, like so: \n\n`/v2/weather/fields/field1/observations/2015-08-01` gets a single day\n`/v2/weather/fields/field1/observations/2015-08-01,2015-08-15` gets everything from August 1-15\n\nYou can customize the response payload using query string parameters. Learn more in the [Daily Observations Documentation](http://developer.awhere.com/api/reference/weather/observations).\n\n_Tip: Remember to use a field ID that exists in your account. By default, this collection uses a default field ID of 'field1'_\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Forecasts",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/weather/fields/field1/forecasts",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"weather",
"fields",
"field1",
"forecasts"
]
},
"description": "####Request\nThis API call gets the forecast at a field location.\n\nWith the default configuration you'll get the hourly forecast for today +8 days. Add dates to the end of the URL to request only specific days, like so: \n\n`/v2/weather/fields/field1/forecasts/YYYY-MM-DD` returns a single day\n`/v2/weather/fields/field1/forecasts/YYYY-MM-DD,YYYY-MM-DD` returns a range of days\n\nYou can also use query string parameters to customize the payloads. Read the [Forecast Documentation](http://developer.awhere.com/api/reference/weather/forecast) for details.\n\n\n_Tip: Remember to use a field ID that exists in your account. By default, this collection uses a default field ID of 'field1'_\n\n\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
},
{
"name": "Norms",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{aWhereAccessToken}}"
}
],
"body": {},
"url": {
"raw": "https://api.awhere.com/v2/weather/fields/field1/norms/08-01,08-15/years/2010,2015",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"v2",
"weather",
"fields",
"field1",
"norms",
"08-01,08-15",
"years",
"2010,2015"
]
},
"description": "####Request\nUse this API to calculate long-term averages for the weather for any set of days across any set of years (minumum 3). This is a very flexible API, and you're encouraged to review the [Weather Norms Documentation](http://developer.awhere.com/api/reference/weather/norms) for details.\n\n_Tip: Remember to use a field ID that exists in your account. By default, this collection uses a default field ID of 'field1'_\n\n####Security\nThis API call uses the security Access Token that is retrieved with the \"Get a Token\" request. If you run that request first, it will save a token to Postman and this API will use it automatically. You can also see where the token should normally go by clicking the \"Headers\" tab below. The Authorization header holds the token, replacing the \"{{aWhereAccessToken}}\" part. \n"
},
"response": []
}
]
},
{
"name": "Get a Token",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"postman.setEnvironmentVariable(\"aWhereAccessToken\", null);"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"var data = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"aWhereAccessToken\", data.access_token);",
""
]
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "{{aWhereAPISecret}}",
"type": "string"
},
{
"key": "username",
"value": "{{aWhereAPIKey}}",
"type": "string"
},
{
"key": "saveHelperData",
"type": "any"
},
{
"key": "showPassword",
"value": false,
"type": "boolean"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "text"
}
]
},
"url": {
"raw": "https://api.awhere.com/oauth/token",
"protocol": "https",
"host": [
"api",
"awhere",
"com"
],
"path": [
"oauth",
"token"
]
},
"description": "This is the first API call you will make any time you use the API \n(but you only need to use once per hour). This request will \nrequest a security access token and save it to Postman. Later \nAPI calls will use the token from Postman's saved variables. \n\n[Authentication Documentation](http://developer.awhere.com/api/authentication)\n\nPrior to using this API call you should load the aWhere Environment\nfile into Postman and change the settings to your API Key and Secret.\nYou can also see where the key and secret should go, or enter\nthem manually, by choosing the \"Authorization\" tab below, selecting\n\"Basic Auth,\" and then entering the key and secret as the username\nand password."
},
"response": []
}
]
}