]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/howto_app.html.twig
Convert french translation
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / Developer / howto_app.html.twig
CommitLineData
b6321bed
NL
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{% trans %}How to create my first application{% endtrans %}{% endblock %}
4
abc32945
NL
5{% block css %}
6 {{ parent() }}
2766668b 7 <link rel="stylesheet" href="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/prism/1.4.1/themes/prism-dark.min.css') }}">
abc32945
NL
8{% endblock %}
9
b6321bed
NL
10{% block content %}
11<div class="row">
12 <div class="col s12">
13 <div class="card-panel settings">
14
15 <div class="row">
f1728141
JB
16 <p>{% trans %}The following commands make use of the <a href="https://github.com/jkbrzt/httpie">HTTPie library</a>. Make sure it is installed on your system before using it.{% endtrans %}</p>
17 <p>{% trans %}You need a token to communicate between your 3rd application and wallabag API.{% endtrans %}</p>
18 <p>{% trans with {'%link%': path('developer_create_client')} %}To create this token, you need <a href="%link%">to create a new client</a>.{% endtrans %}</p>
19 <p>{% trans %}Now, create your token (replace client_id, client_secret, username and password with the good values):{% endtrans %}</p>
b6321bed 20 <p>
abc32945 21 <pre><code class="language-bash">http POST http://v2.wallabag.org/oauth/v2/token \
b6321bed
NL
22 grant_type=password \
23 client_id=12_5um6nz50ceg4088c0840wwc0kgg44g00kk84og044ggkscso0k \
24 client_secret=3qd12zpeaxes8cwg8c0404g888co4wo8kc4gcw0occww8cgw4k \
25 username=yourUsername \
abc32945 26 password=yourPassw0rd</code></pre>
b6321bed 27 </p>
f1728141 28 <p>{% trans %}The API will return a response like this:{% endtrans %}</p>
b6321bed 29 <p>
abc32945 30 <pre><code class="language-bash">HTTP/1.1 200 OK
b6321bed
NL
31Cache-Control: no-store, private
32Connection: close
33Content-Type: application/json
34Date: Tue, 06 Oct 2015 18:24:03 GMT
35Host: localhost:8000
36Pragma: no-cache
37X-Debug-Token: be00a1
38X-Debug-Token-Link: /profiler/be00a1
39X-Powered-By: PHP/5.5.9-1ubuntu4.13
40{
41 "access_token": "ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw",
42 "expires_in": 3600,
43 "refresh_token": "ODBjODU1NWUwNmUzZTBkNDQ5YWVlZTVlMjQ2Y2I0OWM2NTM1ZGM2M2Y3MDhjMTViM2U2MzYxYzRkMDk5ODRlZg",
44 "scope": null,
45 "token_type": "bearer"
abc32945 46}</code></pre>
b6321bed 47 </p>
f1728141 48 <p>{% trans %}The access_token is useful to do a call to the API endpoint. For example:{% endtrans %}</p>
b6321bed 49 <p>
abc32945
NL
50 <pre><code class="language-bash">http GET http://v2.wallabag.org/api/entries.json \
51 "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre>
b6321bed 52 </p>
f1728141
JB
53 <p>{% trans %}This call will return all the entries for your user.{% endtrans %}</p>
54 <p>{% trans with {'%link%': path('nelmio_api_doc_index')} %}If you want to see all the API endpoints, you can have a look <a href="%link%">to our API documentation</a>.{% endtrans %}</p>
abc32945 55 <p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a></p>
b6321bed
NL
56 </div>
57
58 </div>
59 </div>
60</div>
2766668b
JB
61<script src="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/prism/1.4.1/prism.min.js') }}"></script>
62<script src="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/prism/1.4.1/components/prism-bash.min.js') }}"></script>
b6321bed 63{% endblock %}