-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsession.http
More file actions
65 lines (52 loc) · 2.24 KB
/
session.http
File metadata and controls
65 lines (52 loc) · 2.24 KB
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
### test
POST http://localhost:8080/api/online/Session/AuthorisationChallenge
Accept: application/json
Content-Type: application/json
{"contextIdentifier":{"type":"onip","identifier":"3896717236"}}
### AuthorisationChallenge
POST https://{{host}}.mf.gov.pl/api/online/Session/AuthorisationChallenge
Accept: application/json
Content-Type: application/json
{
"contextIdentifier": {
"type": "onip",
"identifier": "{{nip}}"
}
}
> {%
client.global.set("timestamp", response.body.timestamp);
client.global.set("challenge", response.body.challenge);
%}
### InitSessionTokenRequest
# jeśli masz zaszyfrowany token i challange to umieść te wartości w pliku http-client.private.env.json przed wywołaniem
POST https://{{host}}.mf.gov.pl/api/online/Session/InitToken
Accept: application/json
Content-Type: application/octet-stream
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns3:InitSessionTokenRequest xmlns="http://ksef.mf.gov.pl/schema/gtw/svc/online/types/2021/10/01/0001" xmlns:ns2="http://ksef.mf.gov.pl/schema/gtw/svc/types/2021/10/01/0001" xmlns:ns3="http://ksef.mf.gov.pl/schema/gtw/svc/online/auth/request/2021/10/01/0001">
<ns3:Context>
<Challenge>{{challenge}}</Challenge>
<Identifier xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:SubjectIdentifierByCompanyType">
<ns2:Identifier>{{nip}}</ns2:Identifier>
</Identifier>
<DocumentType>
<ns2:Service>KSeF</ns2:Service>
<ns2:FormCode>
<ns2:SystemCode>FA (2)</ns2:SystemCode>
<ns2:SchemaVersion>1-0E</ns2:SchemaVersion>
<ns2:TargetNamespace>http://crd.gov.pl/wzor/2023/06/29/12648/</ns2:TargetNamespace>
<ns2:Value>FA</ns2:Value>
</ns2:FormCode>
</DocumentType>
<Token>{{encryptedToken}}</Token>
</ns3:Context>
</ns3:InitSessionTokenRequest>
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 201, "Response status is not 201");
});
client.global.set("token", response.body.sessionToken.token);
%}
### Session status
GET https://{{host}}.mf.gov.pl/api/online/Session/Status?PageSize=100&PageOffset=0&IncludeDetails=true
SessionToken: {{token}}