-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsharepoint.html
166 lines (156 loc) · 5.91 KB
/
sharepoint.html
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<script type="text/javascript">
RED.nodes.registerType('nodeRedSharepoint-access', {
category: 'config',
defaults: {
name: {
value: '',
required: true
}
},
paletteName: 'nodeRedSharepoint-access',
credentials: {
username: {
type: 'text',
required: true
},
password: {
type: 'password',
required: true
},
domain: {
type: 'text',
value: '',
required: false
}
},
label: function () {
return this.name || 'nodeRedSharepoint';
}
});
</script>
<script type="text/x-red" data-template-name="nodeRedSharepoint-access">
<div class="form-row">
<label for="node-config-input-name"><i class="icon-bookmark"></i>Config name</label>
<input type="text" id="node-config-input-name">
</div>
<div class="form-row">
<label for="node-config-input-username"><i class="fa fa-envelope"></i> User name(email)</label>
<input type="text" id="node-config-input-username">
</div>
<div class="form-row">
<label for="node-config-input-email">Password</label>
<input type="password" id="node-config-input-password">
</div>
<div class="form-row">
<label for="node-config-input-domain">Domain(optional)</label>
<input type="text" id="node-config-input-domain">
</div>
</script>
<script type="text/x-red" data-help-name="nodeRedSharepoint-access"><p>Node for acess to MS Sharepoint services.</p>
<p><a href="https://github.com/s-KaiNet/sp-request">More info</a></p>
</script>
<script type="text/javascript">
RED.nodes.registerType('nodeRedSharepoint', {
category: 'function',
color: '#009639',
defaults: {
sharepoint: {
value: '',
type: 'nodeRedSharepoint-access',
required: true
},
name: {
value: 'Sharepoint WS',
required: false
},
method: {
value: 'GET',
required: false
},
serviceUri: {
value: '',
required: false
}
},
inputs: 1,
outputs: 2,
paletteLabel: 'MS Sharepoint',
icon: 'white-globe.png',
label: function() {
return this.name || 'nodeRedSharepoint';
}
});
</script>
<script type="text/x-red" data-template-name="nodeRedSharepoint">
<div class="form-row">
<label for="node-input-name"><i class="icon-bookmark"></i>Node name</label>
<input type="text" id="node-input-name" placeholder="Sharepoint">
</div>
<div class="form-row">
<label for="node-input-sharepoint">Config</label>
<input type="text" id="node-input-sharepoint" placeholder="Sharepoint config">
</div>
<div class="form-row">
<label for="node-input-method">Method</label>
<select id="node-input-method" placeholder="Choose a method..">
<option value="GET">GET</option>
<option value="POST">POST</option>
</select>
</div>
<div class="form-row">
<label for="node-input-serviceUri">URL service</label>
<input type="text" id="node-input-serviceUri" placeholder="Sharepoint">
</div>
</script>
<script type="text/x-red" data-help-name="nodeRedSharepoint">
<p>A simple node for MS SharePoint REST API (NTLM authentication). Supports GET and POST methods</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>msg.spURL
<span class="property-type">string</span>
</dt>
<dd> End point REST. Specified in the config(URL service) or passed in stream mode. URL must contain "/_api/" path.<br>
<i>Example: http://server/site/_api/lists/getbytitle('listname')</i>
</dd>
</dl>
<dl class="message-properties">
<dt>msg.headers
<span class="property-type">Object</span>
</dt>
<dd> Special headers for SharePoint <b>POST</b> request (methods, etc). You must specify them yourself. <code>X-RequestDigest</code> not required to specify, it is written automatically.<br><a href="https://docs.microsoft.com/sharepoint/dev/sp-add-ins/complete-basic-operations-using-sharepoint-rest-endpoints#properties-used-in-rest-requests">Additional info</a><br>
Example: <pre><code>msg.headers= {
'X-HTTP-Method': 'MERGE',
'IF-MATCH': '*'
}</code></pre>
</dd>
</dl>
<dl class="message-properties">
<dt>msg.payload
<span class="property-type">Object</span>
</dt>
<dd> Body(data) for our <b>POST</b> request.
Example: <pre><code>msg.payload = {
'__metadata': { 'type': 'SP.List' },
'Title': 'TestList'
}</code></pre><br>
Additional info: <br><a href="https://github.com/s-KaiNet/sp-request#sprequestposturl-options">Link 1</a><br><a href="https://docs.microsoft.com/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service">Link 2</a>
</dd>
</dl>
<h3>Outputs</h3>
<li>1. Standard output result
<dl class="message-properties">
<dt>msg.sharepointresult <span class="property-type">Object</span></dt>
<dd>First output. Result. The object that is returned by the service.</dd>
</dl>
</li>
<li>2. Standard error
<dl class="message-properties">
<dt>msg.error <span class="property-type">Object</span></dt>
<dd>Second output. Error. The error that service returned or Nodejs platform error.</dd>
</dl>
</li>
<h3>Details</h3>
<p><a href="https://github.com/s-KaiNet/node-sp-auth/wiki/SharePoint%20on-premise%20user%20credentials%20authentication"><b>Used NTLM authentication!</b></a></p>
<p>The <b>GET</b> method does not need to be specified <code>msg.headers</code> and <code>msg.payload</code>, the request parameters are transmitted in the URL itself (path, filters, etc.)</p>
<p><a href="https://docs.microsoft.com/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service#sharepoint-rest-endpoint-examples">For more info</a></p>
</script>