Skip to main content

CollectionRequestsService

A list of all methods in the CollectionRequestsService service. Click on the method name to view detailed information about that method.

MethodsDescription
getRequestCommentsGets all comments left by users in a request.
createRequestCommentCreates a comment on a request. Note: This endpoint accepts a max of 10,000 characters.
updateRequestCommentUpdates a comment on a request. Note: This endpoint accepts a max of 10,000 characters.
deleteRequestCommentDeletes a comment from a request. On success, this returns an HTTP 204 No Content response Note: Deleting the first comment of a thread deletes all the comments in the thread.

getRequestComments

Gets all comments left by users in a request.

  • HTTP Method: GET
  • Endpoint: /collections/{collectionId}/requests/{requestId}/comments

Parameters

NameTypeRequiredDescription
collectionIdstringThe collection's unique ID.
requestIdstringThe request's unique ID.

Return Type

CommentResponse

Example Usage Code Snippet

import { PostmanClient } from 'postman_client';

(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});

const { data } = await postmanClient.collectionRequests.getRequestComments(
'12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2',
'12345678-c82dd02c-4870-4907-8fcb-593a876cf05b',
);

console.log(data);
})();

createRequestComment

Creates a comment on a request. Note: This endpoint accepts a max of 10,000 characters.

  • HTTP Method: POST
  • Endpoint: /collections/{collectionId}/requests/{requestId}/comments

Parameters

NameTypeRequiredDescription
bodyCommentCreateUpdateThe request body.
collectionIdstringThe collection's unique ID.
requestIdstringThe request's unique ID.

Return Type

CommentCreatedUpdated

Example Usage Code Snippet

import { CommentCreateUpdate, PostmanClient } from 'postman_client';

(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});

const userNameType = UserNameType.USER;

const userName: UserName = {
type: userNameType,
id: 87654321,
};

const commentCreateUpdateTags: CommentCreateUpdateTags = {
userName: userName,
};

const input: CommentCreateUpdate = {
body: 'This is an example.',
tags: commentCreateUpdateTags,
};

const { data } = await postmanClient.collectionRequests.createRequestComment(
'12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2',
'12345678-c82dd02c-4870-4907-8fcb-593a876cf05b',
input,
);

console.log(data);
})();

updateRequestComment

Updates a comment on a request. Note: This endpoint accepts a max of 10,000 characters.

  • HTTP Method: PUT
  • Endpoint: /collections/{collectionId}/requests/{requestId}/comments/{commentId}

Parameters

NameTypeRequiredDescription
bodyCommentCreateUpdateThe request body.
collectionIdstringThe collection's unique ID.
requestIdstringThe request's unique ID.
commentIdnumberThe comment's ID.

Return Type

CommentCreatedUpdated

Example Usage Code Snippet

import { CommentCreateUpdate, PostmanClient } from 'postman_client';

(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});

const userNameType = UserNameType.USER;

const userName: UserName = {
type: userNameType,
id: 87654321,
};

const commentCreateUpdateTags: CommentCreateUpdateTags = {
userName: userName,
};

const input: CommentCreateUpdate = {
body: 'This is an example.',
tags: commentCreateUpdateTags,
};

const { data } = await postmanClient.collectionRequests.updateRequestComment(
'12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2',
'12345678-c82dd02c-4870-4907-8fcb-593a876cf05b',
46814,
input,
);

console.log(data);
})();

deleteRequestComment

Deletes a comment from a request. On success, this returns an HTTP 204 No Content response Note: Deleting the first comment of a thread deletes all the comments in the thread.

  • HTTP Method: DELETE
  • Endpoint: /collections/{collectionId}/requests/{requestId}/comments/{commentId}

Parameters

NameTypeRequiredDescription
collectionIdstringThe collection's unique ID.
requestIdstringThe request's unique ID.
commentIdnumberThe comment's ID.

Example Usage Code Snippet

import { PostmanClient } from 'postman_client';

(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});

const { data } = await postmanClient.collectionRequests.deleteRequestComment(
'12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2',
'12345678-c82dd02c-4870-4907-8fcb-593a876cf05b',
46814,
);

console.log(data);
})();

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →