Suggestions

close search

Greeting file management

When you use Play Action in SCCO, you must set "fileName" with the name of the uploaded WAV/MP3 file. The following APIs allow you to upload files, manage uploaded files.

Upload a greeting file (simple upload)

URL: https://api.stringee.com/v1/greetingfile?uploadType=simple&desc={YOUR_DESCRIPTION}

HTTP method: POST

Custom HTTP header: Name: X-STRINGEE-AUTH Value: JSON web token (JWT), see Authentication

URL Parameters:

Field Type Require Description
uploadType String Yes Always is "simple"
desc String No Your description

POST data (body):

WAV_OR_MP3_BINARY_DATA

Response:

{
    "r": response_code,
    "filename": "VYWKDLWVXL-1531544847245.mp3",
    "fileSid": "DEMTU17RTDTI88VT",
    "message": "response_message"
}
Field Type Require Description
r Int Yes Response code
message String No Response message
filename String No File name
fileSid String No File fileSid

Sample request

POST /v1/greetingfile?uploadType=simple&desc=File_for_IVR_1 HTTP/1.1
Host: https://api.stringee.com
X-STRINGEE-AUTH: json_web_token
Accept: application/json

WAV_OR_MP3_BINARY_DATA

Sample response

{
    "r": 0,
    "filename": "VYWKDLWVXL-1531544847245.mp3",
    "fileSid": "DEMTU17RTDTI88VT",
    "message": "Upload file success"
}

Upload a greeting file (multipart upload)

URL: https://api.stringee.com/v1/greetingfile?uploadType=multipart&desc={YOUR_DESCRIPTION}

HTTP method: POST

Custom HTTP header: Name: X-STRINGEE-AUTH Value: JSON web token (JWT), see Authentication

URL Parameters:

Field Type Require Description
uploadType String Yes Always is "multipart"
desc String No Your description

Sample HTML Form

<form action = "https://api.stringee.com/v1/greetingfile?uploadType=multipart&desc=upload-using-multipart-1&access_token=YOUR_ACCESS_TOKEN"

    method="post" enctype="multipart/form-data">                        

    <input type="file" name="file">

    <input type="submit" value="Upload">

</form>

Sample response

{
    "r": 0,
    "filename": "VYWKDLWVXL-1531544847245.mp3",
    "fileSid": "DEMTU17RTDTI88VT",
    "message": "Upload file success"
}

List greeting files

URL: https://api.stringee.com/v1/greetingfile

HTTP method: GET

Custom HTTP header: Name: X-STRINGEE-AUTH Value: JSON web token (JWT), see Authentication

Response:

{
    "r": 0,
    "message": "Load greeting files success",
    "data": {
        "greeting_files": [
            {
                "sid": "DEMTU17RTDTI88VT",
                "account_id": 408,
                "project_id": 225,
                "filename": "VYWKDLWVXL-1531544847245.mp3",
                "desc1": null,
                "created": 1531544847
            }
        ],
        "total": "1"
    }
}
Field Type Require Description
r Int Yes Response code
message String No Response message
greeting_files JSON Array No Greeting files

Sample request

GET /v1/greetingfile HTTP/1.1
Host: https://api.stringee.com
X-STRINGEE-AUTH: json_web_token
Accept: application/json

Sample response

{
    "r": 0,
    "message": "Load greeting files success",
    "data": {
        "greeting_files": [
            {
                "sid": "DEMTU17RTDTI88VT",
                "account_id": 408,
                "project_id": 225,
                "filename": "VYWKDLWVXL-1531544847245.mp3",
                "desc1": null,
                "created": 1531544847
            }
        ],
        "total": "1"
    }
}

Delete a greeting file

URL: https://api.stringee.com/v1/greetingfile/{GREETING_FILE_ID}

HTTP method: DELETE

Content-Type: application/json

Custom HTTP header: Name: X-STRINGEE-AUTH Value: JSON web token (JWT), see Authentication

URI Parameters:

Field Type Require Description
{GREETING_FILE_ID} String Yes Greeting file ID

Response:

{
    "r": RESULT_CODE,
    "message": "RESULT_MESSAGE"
}
Field Type Require Description
r Int Yes Result code
message String No Result message

Sample request

DELETE /v1/greetingfile/DEMTU17RTDTI88VT HTTP/1.1
Host: https://api.stringee.com
X-STRINGEE-AUTH: json_web_token
Accept: application/json

Sample response

{
    "r": 0,
    "message": "Delete file success"
}