Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sd-doc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Skripnikov
sd-doc
Commits
2416d912
Commit
2416d912
authored
Dec 12, 2017
by
Valentin Skripnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-
parent
42e4ea32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
2 deletions
+70
-2
docs/integration.rst
docs/integration.rst
+70
-2
No files found.
docs/integration.rst
View file @
2416d912
...
...
@@ -360,9 +360,9 @@ REST API ARTA Synergy доступно только авторизованным
и
его
логин
и
пароль
хранятся
в
конфигурационном
файле
на
сервере
.
Для
реализации
данного
типа
авторизации
надо
передать
в
запросе
заголовок
``
Authorization
``
со
значением
``
Authorization
``
со
значением
:
``
"Basic "
+
Base64
(
"login"
+
":"
+
"password"
)``
``
"Basic "
+
Base64
(
"login"
+
":"
+
"password"
)``
Например
:
...
...
@@ -374,6 +374,74 @@ REST API ARTA Synergy доступно только авторизованным
|
Значение
заголовка
|
`
Basic
QWRtaW5pc3RyYXRvcjoxMjM0NTY
=`
|
+--------------------+--------------------------------------+
..
code
-
block
::
:
emphasize
-
lines
:
3
POST
/
Synergy
/
rest
/
api
/
report
/
do
?
reportID
=
daa64ab2
-
1
a79
-
4
ea2
-
9
c24
-
372e35
d9da3e
&
amp
;
fileName
=
report
.
pdf
HTTP
/
1.1
Host
:
demo
.
arta
.
kz
Authorization
:
Basic
QWRtaW5pc3RyYXRvcjoxMjM0NTY
=
Cache
-
Control
:
no
-
cache
Content
-
Type
:
multipart
/
form
-
data
Пример
кода
на
JAVA
:
..
code
-
block
::
java
:
emphasize
-
lines
:
2
HttpResponse
<
String
>
response
=
Unirest
.
post
(
"https://demo.arta.kz/Synergy/rest/api/report/do?reportID=daa64ab2-1a79-4ea2-9c24-372e35d9da3e&fileName=report.pdf"
)
.
header
(
"authorization"
,
"Basic QWRtaW5pc3RyYXRvcjoxMjM0NTY="
)
.
header
(
"cache-control"
,
"no-cache"
)
.
asString
();
Пример
кода
на
JavaScript
(
jQuery
):
..
code
-
block
::
js
:
emphasize
-
lines
:
7
var
settings
=
{
"async"
:
true
,
"crossDomain"
:
true
,
"url"
:
"https://demo.arta.kz/Synergy/rest/api/report/do?reportID=daa64ab2-1a79-4ea2-9c24-372e35d9da3e&fileName=report.pdf"
,
"method"
:
"POST"
,
"headers"
:
{
"authorization"
:
"Basic QWRtaW5pc3RyYXRvcjoxMjM0NTY="
,
"cache-control"
:
"no-cache"
}
}
$.
ajax
(
settings
).
done
(
function
(
response
)
{
console
.
log
(
response
);
});
Пример
кода
на
PHP
:
..
code
-
block
::
php
:
emphasize
-
lines
:
14
<?
php
$
request
=
new
HttpRequest
();
$
request
->
setUrl
(
'https://demo.arta.kz/Synergy/rest/api/report/do'
);
$
request
->
setMethod
(
HTTP_METH_POST
);
$
request
->
setQueryData
(
array
(
'reportID'
=>
'daa64ab2-1a79-4ea2-9c24-372e35d9da3e'
,
'fileName'
=>
'report.pdf'
));
$
request
->
setHeaders
(
array
(
'cache-control'
=>
'no-cache'
,
'authorization'
=>
'Basic QWRtaW5pc3RyYXRvcjoxMjM0NTY='
));
try
{
$
response
=
$
request
->
send
();
echo
$
response
->
getBody
();
}
catch
(
HttpException
$
ex
)
{
echo
$
ex
;
}
Сессионная
авторизация
~~~~~~~~~~~~~~~~~~~~~~
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment