šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@aweber/zendesk-requests

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aweber/zendesk-requests

Front end client for zendesk

2.0.0
latest
Source
npm
Version published
Maintainers
3
Created
Source

zendesk-requests

Front end client for zendesk

Documentation

Quickstart example:

import ZendeskRequests, { RequestsError } from '@aweber/zendesk-requests';

const requests = new ZendeskRequests('mysubdomain');
const promise = requests.create({
    requester: {
        name: 'Anonymous'
    },
    subject: 'Request subject',
    comment: {
        body: 'This is the body'
    }
});
promise.catch((e) => {
    if(e instanceof RequestsError &&
            e.status === 422 &&
            e.json.error === 'RecordInvalid') {
        // Handle validation error
    } else {
        throw e;
    }
});

API

new RequestsClient(subdomain)

Creates a client for the front end.

ParamTypeDescription
subdomainstringthe subdomain for your account

RequestsClient.create(request) ⇒ Promise.<Object, Error>

Creates an anonymous Zendesk request.

Returns: Promise.<Object, Error> - the zendesk request that was created is resolved by the promise, else it throws a RequestsError

ParamTypeDescription
requestObjectrequest object as documented in zendesk

RequestsError

Thrown when a non-successful HTTP status was returned.

KeyDescription
messageResponse body text
statusHTTP status code
jsonResponse body as JSON, or null if not valid JSON

Keywords

zendesk

FAQs

Package last updated on 10 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts