(content)
Methods related to Content
- check - Check your content against your preset styleguide.
- correct - Apply the style guide suggestions directly to your content.
Check your content against your preset styleguide.
import { Writer } from "@writerai/writer-sdk";
const writer = new Writer({
apiKey: "<YOUR_API_KEY_HERE>",
organizationId: 935464,
});
async function run() {
const contentRequest = {
content: "<value>",
settings: {
ageAndFamilyStatus: false,
confidence: false,
contentSafeguards: false,
disability: false,
genderIdentitySensitivity: false,
genderInclusiveNouns: false,
genderInclusivePronouns: false,
grammar: false,
healthyCommunication: false,
passiveVoice: false,
raceEthnicityNationalitySensitivity: false,
sexualOrientationSensitivity: false,
spelling: false,
substanceUseSensitivity: false,
unclearReference: false,
wordiness: false,
},
};
const teamId = 38270;
const organizationId = 919579;
const result = await writer.content.check(contentRequest, teamId, organizationId);
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
contentRequest |
shared.ContentRequest | ✔️ | N/A |
teamId |
number | ✔️ | N/A |
organizationId |
number | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.ContentCheckResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.FailResponse | 400,401,403,404,500 | application/json |
errors.SDKError | 4xx-5xx | / |
Apply the style guide suggestions directly to your content.
import { Writer } from "@writerai/writer-sdk";
const writer = new Writer({
apiKey: "<YOUR_API_KEY_HERE>",
organizationId: 501355,
});
async function run() {
const contentRequest = {
content: "<value>",
settings: {
ageAndFamilyStatus: false,
confidence: false,
contentSafeguards: false,
disability: false,
genderIdentitySensitivity: false,
genderInclusiveNouns: false,
genderInclusivePronouns: false,
grammar: false,
healthyCommunication: false,
passiveVoice: false,
raceEthnicityNationalitySensitivity: false,
sexualOrientationSensitivity: false,
spelling: false,
substanceUseSensitivity: false,
unclearReference: false,
wordiness: false,
},
};
const teamId = 31310;
const xRequestID = "<value>";
const organizationId = 383223;
const result = await writer.content.correct(contentRequest, teamId, xRequestID, organizationId);
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
contentRequest |
shared.ContentRequest | ✔️ | N/A |
teamId |
number | ✔️ | N/A |
xRequestID |
string | ➖ | N/A |
organizationId |
number | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.ContentCorrectResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.FailResponse | 400,401,403,404,500 | application/json |
errors.SDKError | 4xx-5xx | / |