whatsapp-typescript-axios
Advanced tools
Comparing version
@@ -16,5 +16,3 @@ /** | ||
import type { DeleteMedia200Response } from '../models'; | ||
import type { ResumeUploadSession200Response } from '../models'; | ||
import type { RetrieveMediaUrl200Response } from '../models'; | ||
import type { UploadFileData200Response } from '../models'; | ||
import type { UploadImage200Response } from '../models'; | ||
@@ -45,10 +43,2 @@ import type { UploadSession200Response } from '../models'; | ||
/** | ||
* Resume an interrupted upload session by making a GET request. This will return the file offset to resume uploading from. | ||
* @summary Resume Upload Session | ||
* @param {string} uploadSessionId | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
resumeUploadSession: (uploadSessionId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; | ||
/** | ||
* To retrieve your media’s URL, make a **GET** call to **`/{{Media-ID}}`**. Use the returned URL to download the media file. Note that clicking this URL (i.e. performing a generic GET) will not return the media; you must include an access token. For more information, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). You can also use the optional query **`?phone_number_id`** for **`Retrieve Media URL`** and **`Delete Media`**. This parameter checks to make sure the media belongs to the phone number before retrieval or deletion. #### Response A successful response includes an object with a media URL. The URL is only valid for 5 minutes. To use this URL, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). | ||
@@ -63,13 +53,2 @@ * @summary Retrieve Media URL | ||
/** | ||
* Upload file data in chunks by making a POST request with the upload session ID. This is step 2 of the upload process. **Example Request:** ```bash curl -i -X POST \"https://graph.facebook.com/v22.0/upload:<UPLOAD_SESSION_ID>\" \\ --header \"Authorization: OAuth <USER_ACCESS_TOKEN>\" \\ --header \"file_offset: 0\" \\ --data-binary @<FILE_NAME> ``` | ||
* @summary Upload File Data | ||
* @param {string} uploadSessionId | ||
* @param {string} sig Signature parameter for the upload session | ||
* @param {number} [fileOffset] The byte offset to start uploading from | ||
* @param {File} [body] | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
uploadFileData: (uploadSessionId: string, sig: string, fileOffset?: number, body?: File, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; | ||
/** | ||
* This request uploads an image as .jpeg. The parameters are specified as **form-data** in the request **body**. | ||
@@ -119,10 +98,2 @@ * @summary Upload Image | ||
/** | ||
* Resume an interrupted upload session by making a GET request. This will return the file offset to resume uploading from. | ||
* @summary Resume Upload Session | ||
* @param {string} uploadSessionId | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
resumeUploadSession(uploadSessionId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResumeUploadSession200Response>>; | ||
/** | ||
* To retrieve your media’s URL, make a **GET** call to **`/{{Media-ID}}`**. Use the returned URL to download the media file. Note that clicking this URL (i.e. performing a generic GET) will not return the media; you must include an access token. For more information, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). You can also use the optional query **`?phone_number_id`** for **`Retrieve Media URL`** and **`Delete Media`**. This parameter checks to make sure the media belongs to the phone number before retrieval or deletion. #### Response A successful response includes an object with a media URL. The URL is only valid for 5 minutes. To use this URL, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). | ||
@@ -137,13 +108,2 @@ * @summary Retrieve Media URL | ||
/** | ||
* Upload file data in chunks by making a POST request with the upload session ID. This is step 2 of the upload process. **Example Request:** ```bash curl -i -X POST \"https://graph.facebook.com/v22.0/upload:<UPLOAD_SESSION_ID>\" \\ --header \"Authorization: OAuth <USER_ACCESS_TOKEN>\" \\ --header \"file_offset: 0\" \\ --data-binary @<FILE_NAME> ``` | ||
* @summary Upload File Data | ||
* @param {string} uploadSessionId | ||
* @param {string} sig Signature parameter for the upload session | ||
* @param {number} [fileOffset] The byte offset to start uploading from | ||
* @param {File} [body] | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
uploadFileData(uploadSessionId: string, sig: string, fileOffset?: number, body?: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UploadFileData200Response>>; | ||
/** | ||
* This request uploads an image as .jpeg. The parameters are specified as **form-data** in the request **body**. | ||
@@ -192,10 +152,2 @@ * @summary Upload Image | ||
/** | ||
* Resume an interrupted upload session by making a GET request. This will return the file offset to resume uploading from. | ||
* @summary Resume Upload Session | ||
* @param {MediaApiResumeUploadSessionRequest} requestParameters Request parameters. | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
resumeUploadSession(requestParameters: MediaApiResumeUploadSessionRequest, options?: RawAxiosRequestConfig): AxiosPromise<ResumeUploadSession200Response>; | ||
/** | ||
* To retrieve your media’s URL, make a **GET** call to **`/{{Media-ID}}`**. Use the returned URL to download the media file. Note that clicking this URL (i.e. performing a generic GET) will not return the media; you must include an access token. For more information, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). You can also use the optional query **`?phone_number_id`** for **`Retrieve Media URL`** and **`Delete Media`**. This parameter checks to make sure the media belongs to the phone number before retrieval or deletion. #### Response A successful response includes an object with a media URL. The URL is only valid for 5 minutes. To use this URL, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). | ||
@@ -209,10 +161,2 @@ * @summary Retrieve Media URL | ||
/** | ||
* Upload file data in chunks by making a POST request with the upload session ID. This is step 2 of the upload process. **Example Request:** ```bash curl -i -X POST \"https://graph.facebook.com/v22.0/upload:<UPLOAD_SESSION_ID>\" \\ --header \"Authorization: OAuth <USER_ACCESS_TOKEN>\" \\ --header \"file_offset: 0\" \\ --data-binary @<FILE_NAME> ``` | ||
* @summary Upload File Data | ||
* @param {MediaApiUploadFileDataRequest} requestParameters Request parameters. | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
uploadFileData(requestParameters: MediaApiUploadFileDataRequest, options?: RawAxiosRequestConfig): AxiosPromise<UploadFileData200Response>; | ||
/** | ||
* This request uploads an image as .jpeg. The parameters are specified as **form-data** in the request **body**. | ||
@@ -267,15 +211,2 @@ * @summary Upload Image | ||
/** | ||
* Request parameters for resumeUploadSession operation in MediaApi. | ||
* @export | ||
* @interface MediaApiResumeUploadSessionRequest | ||
*/ | ||
export interface MediaApiResumeUploadSessionRequest { | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof MediaApiResumeUploadSession | ||
*/ | ||
readonly uploadSessionId: string; | ||
} | ||
/** | ||
* Request parameters for retrieveMediaUrl operation in MediaApi. | ||
@@ -300,33 +231,2 @@ * @export | ||
/** | ||
* Request parameters for uploadFileData operation in MediaApi. | ||
* @export | ||
* @interface MediaApiUploadFileDataRequest | ||
*/ | ||
export interface MediaApiUploadFileDataRequest { | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof MediaApiUploadFileData | ||
*/ | ||
readonly uploadSessionId: string; | ||
/** | ||
* Signature parameter for the upload session | ||
* @type {string} | ||
* @memberof MediaApiUploadFileData | ||
*/ | ||
readonly sig: string; | ||
/** | ||
* The byte offset to start uploading from | ||
* @type {number} | ||
* @memberof MediaApiUploadFileData | ||
*/ | ||
readonly fileOffset?: number; | ||
/** | ||
* | ||
* @type {File} | ||
* @memberof MediaApiUploadFileData | ||
*/ | ||
readonly body?: File; | ||
} | ||
/** | ||
* Request parameters for uploadImage operation in MediaApi. | ||
@@ -413,11 +313,2 @@ * @export | ||
/** | ||
* Resume an interrupted upload session by making a GET request. This will return the file offset to resume uploading from. | ||
* @summary Resume Upload Session | ||
* @param {MediaApiResumeUploadSessionRequest} requestParameters Request parameters. | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof MediaApi | ||
*/ | ||
resumeUploadSession(requestParameters: MediaApiResumeUploadSessionRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ResumeUploadSession200Response, any>>; | ||
/** | ||
* To retrieve your media’s URL, make a **GET** call to **`/{{Media-ID}}`**. Use the returned URL to download the media file. Note that clicking this URL (i.e. performing a generic GET) will not return the media; you must include an access token. For more information, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). You can also use the optional query **`?phone_number_id`** for **`Retrieve Media URL`** and **`Delete Media`**. This parameter checks to make sure the media belongs to the phone number before retrieval or deletion. #### Response A successful response includes an object with a media URL. The URL is only valid for 5 minutes. To use this URL, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). | ||
@@ -432,11 +323,2 @@ * @summary Retrieve Media URL | ||
/** | ||
* Upload file data in chunks by making a POST request with the upload session ID. This is step 2 of the upload process. **Example Request:** ```bash curl -i -X POST \"https://graph.facebook.com/v22.0/upload:<UPLOAD_SESSION_ID>\" \\ --header \"Authorization: OAuth <USER_ACCESS_TOKEN>\" \\ --header \"file_offset: 0\" \\ --data-binary @<FILE_NAME> ``` | ||
* @summary Upload File Data | ||
* @param {MediaApiUploadFileDataRequest} requestParameters Request parameters. | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof MediaApi | ||
*/ | ||
uploadFileData(requestParameters: MediaApiUploadFileDataRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<UploadFileData200Response, any>>; | ||
/** | ||
* This request uploads an image as .jpeg. The parameters are specified as **form-data** in the request **body**. | ||
@@ -443,0 +325,0 @@ * @summary Upload Image |
@@ -110,34 +110,2 @@ "use strict"; | ||
/** | ||
* Resume an interrupted upload session by making a GET request. This will return the file offset to resume uploading from. | ||
* @summary Resume Upload Session | ||
* @param {string} uploadSessionId | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
resumeUploadSession: (uploadSessionId_1, ...args_1) => __awaiter(this, [uploadSessionId_1, ...args_1], void 0, function* (uploadSessionId, options = {}) { | ||
// verify required parameter 'uploadSessionId' is not null or undefined | ||
(0, common_1.assertParamExists)('resumeUploadSession', 'uploadSessionId', uploadSessionId); | ||
const localVarPath = `/{upload-session-id}` | ||
.replace(`{${"upload-session-id"}}`, encodeURIComponent(String(uploadSessionId))); | ||
// use dummy base URL string because the URL constructor only accepts absolute URLs. | ||
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); | ||
let baseOptions; | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); | ||
const localVarHeaderParameter = {}; | ||
const localVarQueryParameter = {}; | ||
// authentication bearerAuth required | ||
// http bearer authentication required | ||
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); | ||
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); | ||
return { | ||
url: (0, common_1.toPathString)(localVarUrlObj), | ||
options: localVarRequestOptions, | ||
}; | ||
}), | ||
/** | ||
* To retrieve your media’s URL, make a **GET** call to **`/{{Media-ID}}`**. Use the returned URL to download the media file. Note that clicking this URL (i.e. performing a generic GET) will not return the media; you must include an access token. For more information, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). You can also use the optional query **`?phone_number_id`** for **`Retrieve Media URL`** and **`Delete Media`**. This parameter checks to make sure the media belongs to the phone number before retrieval or deletion. #### Response A successful response includes an object with a media URL. The URL is only valid for 5 minutes. To use this URL, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). | ||
@@ -179,48 +147,2 @@ * @summary Retrieve Media URL | ||
/** | ||
* Upload file data in chunks by making a POST request with the upload session ID. This is step 2 of the upload process. **Example Request:** ```bash curl -i -X POST \"https://graph.facebook.com/v22.0/upload:<UPLOAD_SESSION_ID>\" \\ --header \"Authorization: OAuth <USER_ACCESS_TOKEN>\" \\ --header \"file_offset: 0\" \\ --data-binary @<FILE_NAME> ``` | ||
* @summary Upload File Data | ||
* @param {string} uploadSessionId | ||
* @param {string} sig Signature parameter for the upload session | ||
* @param {number} [fileOffset] The byte offset to start uploading from | ||
* @param {File} [body] | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
uploadFileData: (uploadSessionId_1, sig_1, fileOffset_1, body_1, ...args_1) => __awaiter(this, [uploadSessionId_1, sig_1, fileOffset_1, body_1, ...args_1], void 0, function* (uploadSessionId, sig, fileOffset, body, options = {}) { | ||
// verify required parameter 'uploadSessionId' is not null or undefined | ||
(0, common_1.assertParamExists)('uploadFileData', 'uploadSessionId', uploadSessionId); | ||
// verify required parameter 'sig' is not null or undefined | ||
(0, common_1.assertParamExists)('uploadFileData', 'sig', sig); | ||
const localVarPath = `/{upload-session-id}` | ||
.replace(`{${"upload-session-id"}}`, encodeURIComponent(String(uploadSessionId))); | ||
// use dummy base URL string because the URL constructor only accepts absolute URLs. | ||
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); | ||
let baseOptions; | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); | ||
const localVarHeaderParameter = {}; | ||
const localVarQueryParameter = {}; | ||
// authentication OAuth required | ||
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration); | ||
if (sig !== undefined) { | ||
localVarQueryParameter['sig'] = sig; | ||
} | ||
localVarHeaderParameter['Content-Type'] = 'application/pdf'; | ||
if (fileOffset != null) { | ||
localVarHeaderParameter['file_offset'] = typeof fileOffset === 'string' | ||
? fileOffset | ||
: JSON.stringify(fileOffset); | ||
} | ||
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); | ||
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration); | ||
return { | ||
url: (0, common_1.toPathString)(localVarUrlObj), | ||
options: localVarRequestOptions, | ||
}; | ||
}), | ||
/** | ||
* This request uploads an image as .jpeg. The parameters are specified as **form-data** in the request **body**. | ||
@@ -365,18 +287,2 @@ * @summary Upload Image | ||
/** | ||
* Resume an interrupted upload session by making a GET request. This will return the file offset to resume uploading from. | ||
* @summary Resume Upload Session | ||
* @param {string} uploadSessionId | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
resumeUploadSession(uploadSessionId, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
const localVarAxiosArgs = yield localVarAxiosParamCreator.resumeUploadSession(uploadSessionId, options); | ||
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; | ||
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['MediaApi.resumeUploadSession']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; | ||
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); | ||
}); | ||
}, | ||
/** | ||
* To retrieve your media’s URL, make a **GET** call to **`/{{Media-ID}}`**. Use the returned URL to download the media file. Note that clicking this URL (i.e. performing a generic GET) will not return the media; you must include an access token. For more information, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). You can also use the optional query **`?phone_number_id`** for **`Retrieve Media URL`** and **`Delete Media`**. This parameter checks to make sure the media belongs to the phone number before retrieval or deletion. #### Response A successful response includes an object with a media URL. The URL is only valid for 5 minutes. To use this URL, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). | ||
@@ -399,21 +305,2 @@ * @summary Retrieve Media URL | ||
/** | ||
* Upload file data in chunks by making a POST request with the upload session ID. This is step 2 of the upload process. **Example Request:** ```bash curl -i -X POST \"https://graph.facebook.com/v22.0/upload:<UPLOAD_SESSION_ID>\" \\ --header \"Authorization: OAuth <USER_ACCESS_TOKEN>\" \\ --header \"file_offset: 0\" \\ --data-binary @<FILE_NAME> ``` | ||
* @summary Upload File Data | ||
* @param {string} uploadSessionId | ||
* @param {string} sig Signature parameter for the upload session | ||
* @param {number} [fileOffset] The byte offset to start uploading from | ||
* @param {File} [body] | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
uploadFileData(uploadSessionId, sig, fileOffset, body, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
const localVarAxiosArgs = yield localVarAxiosParamCreator.uploadFileData(uploadSessionId, sig, fileOffset, body, options); | ||
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; | ||
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['MediaApi.uploadFileData']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; | ||
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); | ||
}); | ||
}, | ||
/** | ||
* This request uploads an image as .jpeg. The parameters are specified as **form-data** in the request **body**. | ||
@@ -486,12 +373,2 @@ * @summary Upload Image | ||
/** | ||
* Resume an interrupted upload session by making a GET request. This will return the file offset to resume uploading from. | ||
* @summary Resume Upload Session | ||
* @param {MediaApiResumeUploadSessionRequest} requestParameters Request parameters. | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
resumeUploadSession(requestParameters, options) { | ||
return localVarFp.resumeUploadSession(requestParameters.uploadSessionId, options).then((request) => request(axios, basePath)); | ||
}, | ||
/** | ||
* To retrieve your media’s URL, make a **GET** call to **`/{{Media-ID}}`**. Use the returned URL to download the media file. Note that clicking this URL (i.e. performing a generic GET) will not return the media; you must include an access token. For more information, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). You can also use the optional query **`?phone_number_id`** for **`Retrieve Media URL`** and **`Delete Media`**. This parameter checks to make sure the media belongs to the phone number before retrieval or deletion. #### Response A successful response includes an object with a media URL. The URL is only valid for 5 minutes. To use this URL, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). | ||
@@ -507,12 +384,2 @@ * @summary Retrieve Media URL | ||
/** | ||
* Upload file data in chunks by making a POST request with the upload session ID. This is step 2 of the upload process. **Example Request:** ```bash curl -i -X POST \"https://graph.facebook.com/v22.0/upload:<UPLOAD_SESSION_ID>\" \\ --header \"Authorization: OAuth <USER_ACCESS_TOKEN>\" \\ --header \"file_offset: 0\" \\ --data-binary @<FILE_NAME> ``` | ||
* @summary Upload File Data | ||
* @param {MediaApiUploadFileDataRequest} requestParameters Request parameters. | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
uploadFileData(requestParameters, options) { | ||
return localVarFp.uploadFileData(requestParameters.uploadSessionId, requestParameters.sig, requestParameters.fileOffset, requestParameters.body, options).then((request) => request(axios, basePath)); | ||
}, | ||
/** | ||
* This request uploads an image as .jpeg. The parameters are specified as **form-data** in the request **body**. | ||
@@ -570,13 +437,2 @@ * @summary Upload Image | ||
/** | ||
* Resume an interrupted upload session by making a GET request. This will return the file offset to resume uploading from. | ||
* @summary Resume Upload Session | ||
* @param {MediaApiResumeUploadSessionRequest} requestParameters Request parameters. | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof MediaApi | ||
*/ | ||
resumeUploadSession(requestParameters, options) { | ||
return (0, exports.MediaApiFp)(this.configuration).resumeUploadSession(requestParameters.uploadSessionId, options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
/** | ||
* To retrieve your media’s URL, make a **GET** call to **`/{{Media-ID}}`**. Use the returned URL to download the media file. Note that clicking this URL (i.e. performing a generic GET) will not return the media; you must include an access token. For more information, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). You can also use the optional query **`?phone_number_id`** for **`Retrieve Media URL`** and **`Delete Media`**. This parameter checks to make sure the media belongs to the phone number before retrieval or deletion. #### Response A successful response includes an object with a media URL. The URL is only valid for 5 minutes. To use this URL, see [Download Media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#download-media). | ||
@@ -593,13 +449,2 @@ * @summary Retrieve Media URL | ||
/** | ||
* Upload file data in chunks by making a POST request with the upload session ID. This is step 2 of the upload process. **Example Request:** ```bash curl -i -X POST \"https://graph.facebook.com/v22.0/upload:<UPLOAD_SESSION_ID>\" \\ --header \"Authorization: OAuth <USER_ACCESS_TOKEN>\" \\ --header \"file_offset: 0\" \\ --data-binary @<FILE_NAME> ``` | ||
* @summary Upload File Data | ||
* @param {MediaApiUploadFileDataRequest} requestParameters Request parameters. | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof MediaApi | ||
*/ | ||
uploadFileData(requestParameters, options) { | ||
return (0, exports.MediaApiFp)(this.configuration).uploadFileData(requestParameters.uploadSessionId, requestParameters.sig, requestParameters.fileOffset, requestParameters.body, options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
/** | ||
* This request uploads an image as .jpeg. The parameters are specified as **form-data** in the request **body**. | ||
@@ -606,0 +451,0 @@ * @summary Upload Image |
@@ -82,3 +82,2 @@ export * from './create-flow200-response'; | ||
export * from './resumable-upload-upload-file-data200-response'; | ||
export * from './resume-upload-session200-response'; | ||
export * from './retrieve-media-url200-response'; | ||
@@ -139,5 +138,4 @@ export * from './send-message200-response'; | ||
export * from './update-flow-json200-response-validation-errors-inner'; | ||
export * from './upload-file-data200-response'; | ||
export * from './upload-image200-response'; | ||
export * from './upload-session200-response'; | ||
export * from './verify-code-request'; |
@@ -98,3 +98,2 @@ "use strict"; | ||
__exportStar(require("./resumable-upload-upload-file-data200-response"), exports); | ||
__exportStar(require("./resume-upload-session200-response"), exports); | ||
__exportStar(require("./retrieve-media-url200-response"), exports); | ||
@@ -155,3 +154,2 @@ __exportStar(require("./send-message200-response"), exports); | ||
__exportStar(require("./update-flow-json200-response-validation-errors-inner"), exports); | ||
__exportStar(require("./upload-file-data200-response"), exports); | ||
__exportStar(require("./upload-image200-response"), exports); | ||
@@ -158,0 +156,0 @@ __exportStar(require("./upload-session200-response"), exports); |
{ | ||
"name": "whatsapp-typescript-axios", | ||
"version": "1.7.4", | ||
"version": "1.7.5", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1026460
-2.41%474
-1.25%17651
-2.05%