-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
633 lines (546 loc) · 28.5 KB
/
index.html
File metadata and controls
633 lines (546 loc) · 28.5 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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Import2 API</title>
<meta name="author" content="Import2">
<meta name="description" content="">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://developers.import2.com/api-reference">
<link href="/stylesheets/bootstrap/bootstrap.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="/stylesheets/bootstrap/responsive.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="/stylesheets/syntax/syntax.css" media="screen, projection" rel="stylesheet" type="text/css">
<style type="text/css">
body {
padding-bottom: 40px;
}
h1 {
margin-bottom: 15px;
}
img {
max-width: 100%;
}
.sharing, .meta, .pager {
margin: 20px 0px 20px 0px;
}
.page-footer p {
text-align: center;
}
.nowrap {
white-space: nowrap;
}
</style>
<script src="/javascripts/libs/jquery.js"></script>
<script src="/javascripts/libs/modernizr-2.0.js"></script>
<script src="/javascripts/libs/bootstrap.js"></script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<link href="" rel="alternate" title="Import2 API" type="application/atom+xml">
<link href="/favicon-64.png" rel="shortcut icon">
<link href="/favicon-72.png" rel="apple-touch-icon" sizes="72x72" />
<link href="/favicon-114.png" rel="apple-touch-icon" sizes="114x114" />
</head>
<body >
<nav role="navigation"><div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/">Import2 API</a>
<div class="nav-collapse">
</div>
</div>
</div>
</div>
</nav>
<div class="container">
<div class="row-fluid">
<aside class="sidebar-nav span3">
<section class="well">
<ul id="api-toc" class="nav nav-list">
<li class="nav-header">Import2 API</li>
<li class="page">
<a href="/">API Reference</a>
<ul class="nav nav-list nowrap">
<li><a href="/#authentication">Authentication</a></li>
<li><a href="/#sandbox">Sandbox</a></li>
<li><a href="/#response-codes">Response Codes and Errors</a></li>
<li><a href="/#rate-limits">API Rate Limits</a></li>
<li><a href="/#get-tools">GET /tools</a></li>
<li><a href="/#post-imports">POST /imports</a></li>
<li><a href="/#get-imports">GET /imports</a></li>
<li><a href="/#get-import">GET /imports/:id</a></li>
<li><a href="/#post-import-payment-accept">POST /imports/:id/payment/accept</a></li>
<li><a href="/#post-import-payment-reject">POST /imports/:id/payment/reject</a></li>
</ul>
</li>
<li class="page">
<a href="/webhook-reference">Webhook Reference</a>
</li>
<li class="page">
<a href="/changelog">Changelog</a>
</li>
</ul>
</section>
</aside>
<article role="article" class="span9">
<h1 id="api-reference">API Reference</h1>
<p>
<strong>This is API version 2.1.</strong> Make sure you are using <code>https://www.import2.com/api/v2.1</code> as base
URL for all your API requests.
</p>
<h2 id="authentication">Authentication</h2>
<p>
Import2 API uses HTTP Basic Authentication. We expect to receive your API token as value of username parameter.
Here is an example of using API token through curl:
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>curl -i -u aafbdfde226327dafc73:X https://www.import2.com/api/v2.1/imports/3514012b6860e8</span></code></pre></td></tr></table></div></figure>
<p>
<span class="label label-info">Heads up!</span>
If you don't have an API token yet, please contact us at <a href="mailto:partners@import2.com">partners@import2.com</a>.
</p>
<h2 id="sandbox">Sandbox</h2>
<p>
All of the API endpoints (unless stated otherwise) are also available at Sandbox API version: <code>https://www.import2.com/api/sandbox</code>
(i.e. just replace api version in the URL with ‘sandbox’).
Sandbox API endpoints behave exactly as real API, except:
</p>
<dl class="dl-horizontal">
<dt>POST/PUT</dt>
<dd>will run all the validation rules and send corresponding response, but will not actually create or update any
objects
</dd>
<dt>GET</dt>
<dd>will return pre-defined static responses</dd>
<dt>DELETE</dt>
<dd>will return pre-defined static responses, but will not actually delete any objects</dd>
</dl>
<p>
You can play with Sandbox API without being worried about hitting any limits or performing actual imports.
</p>
<p>
<span class="label label-info">Heads up!</span>
Sandbox mimics the behavior of the latest available API version! If you’re developing against
version 2, but there is a version 3 already available, then Sandbox API will be behaving like API v3.
</p>
<h2 id="response-codes">Response Codes and Errors</h2>
<p>
All requests and responses are encoded as JSON.
</p>
<p>
API uses HTTP status codes to inform you about request result. Here are the most frequently seen response codes and
their interpretation:
</p>
<dl class="dl-horizontal">
<dt>
<span class="label label-success">200</span>
</dt>
<dd>Request has succeeded. Parse response body.</dd>
<dt>
<span class="label label-success">201</span>
</dt>
<dd>Request has succeeded and object was created. Parse response body.</dd>
<dt>
<span class="label label-important">400</span>
</dt>
<dd>Request cannot be fulfilled due to bad syntax.</dd>
<dt>
<span class="label label-important">401</span>
</dt>
<dd>Unauthorized. Either no API token was included in the request or API token was invalid.</dd>
<dt>
<span class="label label-important">404</span>
</dt>
<dd>Not Found. The requested resource or migration does not exist, has been archived, or cancelled.</dd>
<dt>
<span class="label label-important">422</span>
</dt>
<dd>The request was well-formed but was unable to be followed due to validation rules. Parse response body.</dd>
<dt>
<span class="label label-important">429</span>
</dt>
<dd>The request was rejected due to exceeding the allowed rate limit.</dd>
</dl>
<h2 id="rate-limits">API Rate Limits</h2>
<p>
API allows up to 10 requests per second across all endpoints.
</p>
<p>
If this limit is exceeded, the API will return a <code>429</code> response.
</p>
<h2 id="get-tools">GET /tools</h2>
<p>
Returns list of tools that are supported as data source for your app.
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>curl -i -X GET -u aafbdfde226327dafc73:X -H "Content-Type: application/json" \
</span><span class='line'>	https://www.import2.com/api/v2.1/tools</span></code></pre></td></tr></table></div></figure>
<p>
Response will have <strong>HTTP status
<span class="label label-success">200</span>
</strong> and body containing array of source tools including their names and slugs:
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 200 Ok
</span><span class='line'>Content-Type: application/json
</span><span class='line'>
</span><span class='line'>[
</span><span class='line'> {"name":"wordpress", "label":"Wordpress"},
</span><span class='line'> {"name":"posterous", "label":"Posterous"},
</span><span class='line'> {"name":"tumblr", "label":"Tumblr"}
</span><span class='line'>]</span></code></pre></td></tr></table></div></figure>
<h2 id="post-imports">POST /imports</h2>
<p>
Creates a partially initialized new import. Responds with the import id and URL of the page where your
customer should be redirected.
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>curl -i -X POST -u aafbdfde226327dafc73:X -H "Content-Type: application/json" \
</span><span class='line'>-d '{"source_tool":"posterous", "destination_instance_url":"http://myblog.tumblr.com/", "destination_username":"username", "destination_token":"token"}' \
</span><span class='line'>https://www.import2.com/api/v2.1/imports</span></code></pre></td></tr></table></div></figure>
<p>
If validation fails, then you will receive response with <strong>HTTP status
<span class="label label-important">422</span>
</strong> and body containing validation errors:
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 422
</span><span class='line'>Content-Type: application/json
</span><span class='line'>
</span><span class='line'>{
</span><span class='line'> "source_tool":["is not supported"],
</span><span class='line'> "destination_instance_url":[], "destination_username":[], "destination_token":["can't be blank"],
</span><span class='line'> "destination":["Couldn't access your Tumblr account due to: 401 Unauthorized"]
</span><span class='line'>}</span></code></pre></td></tr></table></div></figure>
<p>
If validation succeeds and import was created, then response will have <strong>HTTP status
<span class="label label-success">201</span>
</strong> and body containing import identification and redirect URL:
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 201 Created
</span><span class='line'>Content-Type: application/json
</span><span class='line'>
</span><span class='line'>{
</span><span class='line'> "id":"789123",
</span><span class='line'> "token":"ae2cfc164cb94f67f735581d7f9a3c09",
</span><span class='line'> "redirect_url":"https://www.import2.com/imports/7f735581d7f9a3c09/ae2cfc164cb94f67f735581d7f9a3c09"
</span><span class='line'>}</span></code></pre></td></tr></table></div></figure>
<h3>Properties</h3>
<table class="table table-condensed table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Required?</th>
<th>Description</th>
<th>Example values</th>
</tr>
</thead>
<tbody>
<tr>
<td>source_tool</td>
<td><em>required</em></td>
<td>Name of the source tool. Items will be exported from this tool to destination tool.</td>
<td>
“posterous”<br/>
“highrise”
</td>
</tr>
<tr>
<td>destination_instance_url</td>
<td><em>optional</em></td>
<td>Url of the destination tool instance.</td>
<td>
“http://myblog.tumblr.com/”<br/>
“https://mycorp.salesforce.com/”
</td>
</tr>
<tr>
<td>destination_username</td>
<td><em>optional</em></td>
<td>
Username used to sign in into the destination tool (or email address if it is used in destination tool).
</td>
<td>
“janeimport”<br/>
“jane.import@mycorporation.com”
</td>
</tr>
<tr>
<td>destination_token</td>
<td><em>optional</em></td>
<td>API token used to access destination tool.</td>
<td>
“apitoken”
</td>
</tr>
<tr>
<td>start_full</td>
<td><em>optional</em></td>
<td>A boolean flag to initiate immediate full migration, bypassing the sample migration step. It automatically designates the migration as sponsored by you. Default value is false.</td>
<td>
true<br/>
false
</td>
</tr>
</tbody>
</table>
<h2 id="get-imports">GET /imports</h2>
<p>
Returns list of all imports for the given username in the destination tool.
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>curl -i -X GET -u aafbdfde226327dafc73:X -H "Content-Type: application/json" \
</span><span class='line'>https://www.import2.com/api/v2.1/imports?destination_username=username</span></code></pre></td></tr></table></div></figure>
<p>
If no imports found, then you will receive response with <strong>HTTP status
<span class="label label-success">200</span></strong> and response body will contain empty array
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 200 Ok
</span><span class='line'>Content-Type: application/json
</span><span class='line'>
</span><span class='line'>[]</span></code></pre></td></tr></table></div></figure>
<p>
If imports for such username exist, then response will contain list of such imports including their identifications and status:
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 200 Ok
</span><span class='line'>Content-Type: application/json
</span><span class='line'>
</span><span class='line'>[
</span><span class='line'> {
</span><span class='line'> "id":"my-import-id-1",
</span><span class='line'> "token":"my-import-unique-token-1",
</span><span class='line'> "status":"Import Completed",
</span><span class='line'> "items":{"accounts":123, "contacts":234},
</span><span class='line'> "users":{"source_tool":5, "destination_tool":4, "matched":3}
</span><span class='line'> },
</span><span class='line'> {
</span><span class='line'> "id":"my-import-id-2",
</span><span class='line'> "token":"my-import-unique-token-2",
</span><span class='line'> "status":"Sample Import in Progress",
</span><span class='line'> "items":{"accounts":123, "contacts":234},
</span><span class='line'> "users":{"source_tool":5, "destination_tool":4, "matched":3}
</span><span class='line'> },
</span><span class='line'>]</span></code></pre></td></tr></table></div></figure>
<h3>Parameters</h3>
<table class="table table-condensed table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Required?</th>
<th>Description</th>
<th>Example values</th>
</tr>
</thead>
<tbody>
<tr>
<td>destination_username</td>
<td><em>required</em></td>
<td>
Username used to sign in into the destination tool (or email address if it is used in destination tool).
</td>
<td>
“janeimport”<br/>
“jane.import@mycorporation.com”
</td>
</tr>
</tbody>
</table>
<h2 id="get-import">GET /imports/:id</h2>
<p>
Returns status of the import identified by the given id.
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>curl -i -X GET -u aafbdfde226327dafc73:X -H "Content-Type: application/json" \
</span><span class='line'>https://www.import2.com/api/v2.1/imports/my-import-id</span></code></pre></td></tr></table></div></figure>
<p>
If import is not found, was cancelled or archived, then you will receive response with <strong>HTTP status
<span class="label label-important">404</span>
</strong>.
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 404</span></code></pre></td></tr></table></div></figure>
<p>
If import exists — response will have <strong>HTTP status
<span class="label label-success">200</span>
</strong> and body containing import identification, status and warnings (if there are any):
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 200 Ok
</span><span class='line'>Content-Type: application/json
</span><span class='line'>
</span><span class='line'>{
</span><span class='line'> "id":"my-import-id",
</span><span class='line'> "token":"my-import-unique-token",
</span><span class='line'> "status":"Import Completed",
</span><span class='line'> "items":{"accounts":123, "contacts":234},
</span><span class='line'> "users":{"source_tool":5, "destination_tool":4, "matched":3}
</span><span class='line'>}</span></code></pre></td></tr></table></div></figure>
<h3 id="import-statuses">Import Statuses</h3>
<table class="table table-condensed table-bordered">
<thead>
<tr>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Collecting credentials</td>
<td>Customer is authorizing access to their source and destination applications.</td>
</tr>
<tr>
<td>Waiting to start sample migration</td>
<td>Customer has provided credentials, but hasn’t started the sample migration yet.</td>
</tr>
<tr>
<td>Sample migration in progress</td>
<td>Sample migration is currently in progress.</td>
</tr>
<tr>
<td>Sample migration completed</td>
<td>Sample migration has been finished. Customer can review imported data in your application.</td>
</tr>
<tr>
<td>Migration in progress</td>
<td>Full migration is currently in progress.</td>
</tr>
<tr>
<td>Migration completed</td>
<td>Full migration has been finished. Customer can start using their instance of your application.</td>
</tr>
<tr>
<td>Undo in progress</td>
<td>The migration is being undone.</td>
</tr>
<tr>
<td>Migration cleaned</td>
<td>The migration was undone.</td>
</tr>
<tr>
<td>In preparation</td>
<td>Migration is paid and ready to be started.</td>
</tr>
</tbody>
</table>
<h2 id="post-import-payment-accept">POST /imports/:id/payment/accept</h2>
<p>
Accept sponsorship (i.e. obligation to pay) for the import identified by the given id. After this the customer will be able to start full migration from the Import2 UI.
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>curl -i -X POST -u aafbdfde226327dafc73:X -H "Content-Type: application/json" \
</span><span class='line'>https://www.import2.com/api/v2.1/imports/my-import-id/payment/accept</span></code></pre></td></tr></table></div></figure>
<p>
If import is not found, was cancelled or archived, then you will receive response with <strong>HTTP status
<span class="label label-important">404</span>
</strong>.
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 404</span></code></pre></td></tr></table></div></figure>
<p>
If import exists — response will have <strong>HTTP status
<span class="label label-success">200</span>
</strong> and empty body
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 200</span></code></pre></td></tr></table></div></figure>
<h2 id="post-import-payment-reject">POST /imports/:id/payment/reject</h2>
<p>
Reject sponsorship for the import identified by the given id. After this the customer will be able to purchase full migration from Import2 by themselves.
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>curl -i -X POST -u aafbdfde226327dafc73:X -H "Content-Type: application/json" \
</span><span class='line'>https://www.import2.com/api/v2.1/imports/my-import-id/payment/reject</span></code></pre></td></tr></table></div></figure>
<p>
If import is not found, was cancelled or archived, then you will receive response with <strong>HTTP status
<span class="label label-important">404</span>
</strong>.
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 404</span></code></pre></td></tr></table></div></figure>
<p>
If import exists — response will have <strong>HTTP status
<span class="label label-success">200</span>
</strong> and empty body
</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>HTTP/1.1 200</span></code></pre></td></tr></table></div></figure>
</article>
</div>
</div>
<footer role="contentinfo" class="page-footer"><hr>
<p>
Copyright © 2024 - Import2 -
<span class="credit"><a href="https://www.import2.com">https://www.import2.com</a></span>
</p>
</footer>
</body>
</html>