Skip to content

Commit

Permalink
fix(API Guide): Fix various typo errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Mar 12, 2018
1 parent 7a6c5a8 commit 2cccc37
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
27 changes: 21 additions & 6 deletions pages/guide.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ const SENCROP_RAW_DATA_PAYLOAD = `[
]
`;
const CURL_SENCROP_DATA_CODE = `# Get hourly aggregated data for two days
curl "https://api.sencrop.com/v1/users/1664/devices/B16BA4/data/hourly?beforeDate=2017-10-07T07:34:32.000Z&days=2&measures=WIND_DIRECTION,WIND_MEAN"\
curl "https://api.sencrop.com/v1/users/1664/devices/B16BA4/data/hourly?beforeDate=2017-10-07T07:34:32.000Z&days=7&measures=WIND_DIRECTION,WIND_MEAN"\
-H "Authorization: Bearer xxxxx"
# Get daily aggregated data for two days
curl "https://api.sencrop.com/v1/users/1664/devices/B16BA4/data/daily?beforeDate=2017-10-07T07:34:32.000Z&days=2&measures=WIND_DIRECTION,WIND_MEAN"\
curl "https://api.sencrop.com/v1/users/1664/devices/B16BA4/data/daily?beforeDate=2017-10-07T07:34:32.000Z&days=90&measures=WIND_DIRECTION,WIND_MEAN"\
-H "Authorization: Bearer xxxxx"
`;
const SENCROP_DATA_PAYLOAD = `{
Expand Down Expand Up @@ -225,7 +225,7 @@ const SENCROP_DATA_PAYLOAD = `{
}
`;
const CURL_SENCROP_STATISTICS_CODE = `# Get device statistics for two days
curl "https://api.sencrop.com/v1/users/1664/devices/B16BA4/statistics?startDate=2017-01-01T00:00:00.000Z&endDate=2017-02-01T00:00:00.000Z&measures=WIND_DIRECTION,WIND_MEAN"\
curl "https://api.sencrop.com/v1/users/1664/devices/B16BA4/statistics?startDate=2017-01-01T00:00:00.000Z&endDate=2017-02-01T00:00:00.000Z&measures=WIND_DIRECTION,WIND_MEAN&patched=false"\
-H "Authorization: Bearer xxxxx"
`;
const SENCROP_STATISTICS_PAYLOAD = `{
Expand Down Expand Up @@ -457,11 +457,20 @@ const Index = () => (
SENCROP_DEVICES_PAYLOAD
}</SyntaxHighlighter>
<p>
The <code>items</code> property indicates
your the collection of devices you can access
The <code>items</code> property tells
you the collection of devices you can access
to. While the <code>devices</code> hash
allows your to pickup the devices details.
</p>
<p>
You may ask why using that format. It allows
our payload to avoid repating the same
informations several times while not
requiring you to use a specific JSON loader.
It also allows us to significantly reduce
our app memory footprint by easing hash
merges accross our various states.
</p>
<h2>Reading raw device data</h2>
<p>
Your devices regularly send meteoroligical
Expand Down Expand Up @@ -531,6 +540,12 @@ const Index = () => (
<SyntaxHighlighter language="javascript" style={docco}>{
CURL_SENCROP_STATISTICS_CODE
}</SyntaxHighlighter>
<p>
Note the patched parameter that allows your to retrieve
only not patched data (ie only real device data). Setting
it to true or not specifying it will not return
extrapolated leaking data refills.
</p>
<p>The result will look like this:</p>
<SyntaxHighlighter language="json" style={docco}>{
SENCROP_STATISTICS_PAYLOAD
Expand Down Expand Up @@ -672,7 +687,7 @@ const Index = () => (
intensive access to the data in the
meanwhile.
</p>
<h2>What's next ?</h2>
<h2>What&apos;s next ?</h2>
<p>
So you read it all? Impressive! You are
now in the best conditions to use our
Expand Down
8 changes: 4 additions & 4 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export default class Index extends React.Component {
</strong></p>
<p>
Welcome on board! At Sencrop, we love
developers. This platform's goal is
developers. This platform&apos;s goal is
intended to bring you everything you
need to invent tomorrow's farming
need to invent tomorrow&apos;s farming
practices.
</p>
<p>
Expand All @@ -46,7 +46,7 @@ export default class Index extends React.Component {
<p>
Also, you can directly check
our <Link href="/reference"><a>API
reference</a></Link>
reference</a></Link>{' '}
for a more direct appraoch.
</p>
<p>
Expand All @@ -63,7 +63,7 @@ export default class Index extends React.Component {
<p>
PS: This website source can be found
on <a href="https://github.com/sencrop/sencrop-developer-platform"
>GitHub</a>,
>GitHub</a>.
</p>
<h2 id="mailing_list">Developer Mailing List</h2>
<form method="post" action="https://evomedia.us3.list-manage.com/subscribe/post?u=c993ab1c009fbcbc61dea24cd&amp;id=b7ef162deb" target="_blank">
Expand Down

0 comments on commit 2cccc37

Please sign in to comment.