Updated on 2023-09-27 GMT+08:00

Querying a File Server

Scenario

This interface is invoked to query a file server. It can be used before importing an outbound call data file from the server.

Usage Description

  • Prerequisites
    • The corresponding AK/SK authentication permission is available.
    • You have applied for a developer account.
  • Precautions
    • After a request is received, the server needs to return a 200 response. Other responses indicate that the writeback fails.

Method

This interface supports only the POST method.

URI

https://ip:port/rest/isales/v1/openapi/campaigns/{vdnId}/file/queryServer

In the URL, ip indicates the IP address of the CC-iSales server, and port indicates the HTTPS port number of the CC-iSales server.

Table 1 Parameters in the URL

No.

Parameter

Type

Mandatory or Not

Description

1

vdnId

Integer

Yes

VDN ID.

The value is an integer ranging from 1 to 9999.

Request Description

Table 2 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

Content-Type

String

Yes

The value is fixed to application/json; charset=UTF-8.

2

Authorization

String

Yes

For details about the generation mode, see C2 Monitoring, System Outbound Call, CDR, and Knowledge Base Interface Authentication.

Table 3 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1

offset

Integer

Yes

Parameter for determining the start page of the query.

Value of offset = Value of limit x (Value of page – 1)

page indicates the start page to be queried.

2

limit

Integer

Yes

Number of query records on each page.

The value ranges from 1 to 100.

3

serverIds

List <String>

No

File server IDs.

Response Description

Table 4 Response body parameters

No.

Parameter

Type

Description

1

resultCode

String

Error code. The value 0200000 indicates success, and other values indicate failure.

For details, see Table 5.

2

resultDesc

String

Description.

3

server

List <Server>

File server.

4

count

Integer

Total number of files.

5

returnCode

String

Error code. The value 0200000 indicates success, and other values indicate failure.

For details, see Table 5.

6

returnDesc

String

Description.

Server

No.

Parameter

Type

Description

1

port

String

Port number.

2

ip

String

IP address.

3

filePath

String

Default file server path.

4

userName

String

Username.

5

serverId

String

File server ID.

Triggered Event

None

Error Codes

Table 5 Error code description

No.

Error Code

Description

1

0200001

Parameter error. For details about the error, see resultDesc.

2

0200033

The outbound call data does not exist.

3

0200034

The substatus does not match the business result.

4

02000001

Empty parameter.

5

02000002

The parameter contains invalid characters.

6

02000003

The parameter length cannot exceed the maximum length.

7

02000004

The parameter length cannot be less than the minimum length.

8

02000005

The parameter length must be within the specified range.

9

02000006

Incorrect parameter type.

10

02000007

Incorrect parameter value.

11

02000008

Parameter conversion error. Check the request parameters.

12

02000009

Incorrect parameter combination. Check the request parameters.

13

02000010

The hour and minute parameters must be set at the same time.

14

02000011

The number of parameters cannot exceed the specified number.

Example

  • The following provides an example of the request body of this interface:
    {
        "limit":10,
        "offset":0
    }
  • The following provides an example of the response body of this interface:
    {
    	"returnCode": "0200000",
    	"server": [
    		{
    			"port": null,
    			"ip": null,
    			"filePath": null,
    			"userName": "10",
    			"serverId": "164681924997097701747271557174"
    		},
    		{
    			"port": "22",
    			"ip": "10.21.124.175",
    			"filePath": "/home/sftp",
    			"userName": "isales",
    			"serverId": "164690088271159234793429225848"
    		},
    		{
    			"port": "22",
    			"ip": "192.168.0.1",
    			"filePath": "/home/sftp",
    			"userName": "huawei",
    			"serverId": "164697340198671566909690908237"
    		},
    		{
    			"port": "8888",
    			"ip": "1.1.1.1",
    			"filePath": "/sftp/file",
    			"userName": "isales",
    			"serverId": "164765479785832713595318363505"
    		},
    		{
    			"port": "22",
    			"ip": "10.1.1.1",
    			"filePath": "/home/sftp",
    			"userName": "zhangsan",
    			"serverId": "164765490069279981932006087306"
    		}
    	],
    	"resultCode": "0200000",
    	"resultDesc": "success",
    	"returnDesc": "success"
    }