Fieldclimate json api v1 Contents



Download 125.32 Kb.
Date conversion31.07.2017
Size125.32 Kb.
Fieldclimate JSON API V1

Contents




Fieldclimate JSON API V1 1

Contents 1

Introduction 2

About JSON 5

Authentication 5

API Methods 6

API Keys 6

PESSL JSON Library v.01 7

For developers 16



Introduction


This API allows anyone to write applications that interact with Fieldclimate JSON API. You can get started by checking out the API Methods .

The API consists of a set of callable methods and API endpoints. The arguments, responses, and error codes for each method are described.



To perform an action using API, send a request (specifying a method and some parameters) to an API endpoint. A response will then be sent back to you.

All requests take a list of named parameters.

The REST format is a simple JSON-based protocol - it is a conventional HTTP GET or POST action.

The REST endpoint URL is http://www.fieldclimate.com/pikernel/api/

For example, to request the CIDIStationList_GetFirst service, you would invoke the following:



  1. http://www.fieldclimate.com/pikernel/api/CIDIStationList/GetFirst (Friendly URL)

  2. http://www.fieldclimate.com/pikernel/api/index.php?action=CIDIStationList_GetFirst

The required parameter action is used to specify the method to be called.

All responses are returned in JSON format. By default, character encoding is UTF-8.


Successful Response


{"ReturnDataSet":[

{"f_station_code":"282",

"f_date":"2009-04-20 12:07:21",

"f_dev_id":"1",

"f_name":"00000146",

"f_descr":"imetos avr","f_info":"\r\nImetos 1 software: 02.55 hardware: 01.00 compiled: Apr 23 2009 12:23:00",

"f_uid":"2147483647",

"f_status":"0",

"f_create_time":"2007-01-22 08:59:42",

"f_master_name":null,

"f_date_min":"2005-03-08 12:50:00",

"f_date_max":"2010-10-11 02:20:00",

"f_date_last_down":"2010-10-11 01:22:40",

"f_date_sens":"2010-05-20 12:30:50.625755",

"f_date_data":"2010-01-24 19:02:12.19124",

"f_date_conf":"2010-10-11 03:22:40.462109",

"f_sernum":"326",

"f_timezone":"60",

"f_latitude":"47.2055",

"f_longitude":"15.63507",

"f_altitude":"443",

"f_date_comm":1286756560,

"f_user_station_name":"Pessl Instruments Company Weather '\u00b4\u00b4",

"f_user_name":"Pessl Instruments Company Weather '\u00b4\u00b4"}],

"ReturnParams":{"row_count":"1","station_code":1}}

Failure Response


{"faultcode":5,

"faultactor":"CIDIStationList",

"faultstring":"No rights",

"faultdetail":"CIDIData interface error"}





About JSON


JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.

JSON is built on two structures:

* A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.

* An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

These are universal data structures. Virtually all modern programming languages support them in one form or another. It makes sense that a data format that is interchangable with programming languages also be based on these structures.

For more information you can have a look at



http://www.json.org/

http://en.wikipedia.org/wiki/JSON

Authentication


To use Fieldclimate API and authenticate users, it needs username, password or API KEY.

Logging with username and password.

http://www.fieldclimate.com/pikernel/api/index.php?action=CIDIStationList_GetFirst&user_name=austria&user_passw=guest

The required parameter user_name is username Fieldclimate.

The required parameter user_passw is password Fieldclimate.



Logging with with username and API KEY

http://www.fieldclimate.com/pikernel/api/index.php?action=CIDIStationList_GetFirst&user_name=austria&user_passw=&api_key=b6589fc6ab0dc82cf12099d1c2d40ab994e8410c

The required parameter user_name is username Fieldclimate.

The required parameter api_key is specially generated application api key for authorization client's apps .


API Methods


All methods , arguments are described http://www.fieldclimate.com/cidiweb.php

  • CIDIUser

  • CIDIStationList

  • CIDIStationConfig

  • CIDIStationSensors

  • CIDIStationData

  • CIDIFields

  • CIDICrops

  • CIDIDiarySprayList

  • CIDIDiarySprayEvents

More soon coming….

API Keys


For getting API KEY mail the following details to support@metos.at

  • fieldclimate account name

  • domain name of the website, on which you want to show the sticker

After short verification you will receive necessary instructions and code for the sticker

PESSL JSON Library v.01


Pessl Instruments Gmbh has released set of classes javascript libraries. It wrappers all AJAX calls in a nice classes so that you don't need to deal with JSON and AJAX at all.

You can download last version PESSL JSON Library v.01

You can download examples PESSL JSON Examples

Requirements: jQuery 1.3.2

The "Hello, World" of Fieldclimate JSON API V1


The easiest way to start learning about the Fieldclimate JSON API is to see a simple example.

DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">





"Content-Type" content="text/html; charset=UTF-8">
The "Hello, World" of Fieldclimate JSON API </p> <p>V1












The "Hello, World" of Fieldclimate JSON API V1


"dialog-form" title="Login box">

All form fields are required.



"login_error_msg" style="color: red;">







"text" name="name" id="name" />





"password" name="password" id="password" />


"button" value="Login" onclick="doLogin();">






"user-box">

"javascript: Logout();">Logout







Please describe the input/output parameters and output recordset of this method

Live demo is available here The "Hello, World" of Fieldclimate JSON API V1


Reading the List of Stations


DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">





"Content-Type" content="text/html; charset=UTF-8">
Example 1 <a href="/incoming-6th-grade-summer-reading-list-2014.html">- Reading the List of Stations</a>











Example 1 - Reading the List of Stations



"stations_list">






Please describe the input/output parameters and output recordset of this method

Live demo is available here Example 1 - Reading the List of Stations


Getting Configuration of Station


DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">





"Content-Type" content="text/html; charset=UTF-8">
Example 2 - Getting Configuration of Station











Example 2 - Getting Configuration of Station



"station_conf">






Please describe the input/output parameters and output recordset of this method

Live demo is available here Example 2 - Getting Configuration of Station


Getting Sensors Info


DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">





"Content-Type" content="text/html; charset=UTF-8">
Example 3 <a href="/biological--chemical-warfare-agent-detection-chemical-sensors.html">- Getting Sensors Info</a>











Example 3 - Getting Sensors Info



"sensors_div">






Please describe the input/output parameters and output recordset of this method

Include all fields of sensor info into Example 3 - Getting Sensors Info

Live demo is available here Example 3 - Getting Sensors Info


Getting Weather Data


DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">





"Content-Type" content="text/html; charset=UTF-8">
Example 4 - Getting Weather Data











Example 4 - Getting Weather Data



"data_div">






Provide examples for all methods – getfirst, genext, getprev and gelast

Create examples for reading disease models and weather forecast (like in soap manual)

Live demo is available here Example 4 - Getting Weather Data


API Reference


This reference contains inline documentation in JavaScript source files, and produces an documentation of the JavaScript code.

http://91.114.24.18/pikernel/actvers_roman/map/jsdoc/index.html

For developers


After learning the basics of data interface you can start developing your own applications. Here you will find a complete example with Google Map API integration http://www.fieldclimate.com/map/index.html

http://code.google.com/apis/maps/documentation/javascript/

Please send error reports, suggestions, requests for support and examples of your applications to software@metos.at


The database is protected by copyright ©ininet.org 2016
send message

    Main page