API Usage Limit -- SalesPro Seats


#1

Recently, we’ve started getting an API response from the ‘Create or Update Contact’ service relating to the number of sales pro seats we have assigned:

Response: ‘{“usageLimit”:5,“currentUsage”:5,“usagePercent”:100}’

As a result, a new hubspot contact is not created. Anyone else run into this? Under what conditions is this usageLimit relevant to the API call?


#2

Hi @jasmis,

The usage of your available sales professional seats shouldn’t impact your ability to create a contact. Can you reach back out with the full request you’re making (with authentication redacted) so that I can take a look?


#3
const express = require('express');

const router = express.Router();

require('dotenv').config();
const hubSpotApiKey = process.env.HUBSPOT_API_KEY;

const Hubspot = require('hubspot');
const hubspot = new Hubspot({ apiKey: hubSpotApiKey });

router.use((req, res, next) => {
  next();
});

router.post('/hubpost', (req, res) => {
  hubspot.contacts
    .createOrUpdate(req.body.email, {
      properties: [
        {
          property: 'email',
          value: req.body.email,
        },
        ....
      ],
    })
    .then((results) => {
      res.send(results);
    })
    .catch((err) => {
      res.send(err);
    });
});

router.post('/hubpost_deal', (req, res) => {
  hubspot.deals
    .create({
      associations: {
        associatedVids: [req.body.vid],
      },
      properties: [
        {
          name: 'dealname',
          value: `${req.body.firstname} ${req.body.lastname}`,
        },
        .......
      ],
    })
    .then((results) => {
      res.send(results);
    })
    .catch((err) => {
      res.send(err);
    });
});

router.post('/hubpost_getlanded', (req, res) => {
  let requestBody;
  if (req.body.applicationCompleteDate) {
    requestBody = {
      properties: [
        {
          property: 'income',
          value: req.body.income,
        },
        .......
      ],
    };
  } else if (req.body.surveyCompletionDate) {
    requestBody = {
      properties: [
        {
          property: 'homeowner',
          value: req.body.currentOwner.owner,
        },
        ......
      ],
    };
  } else {
    requestBody = {
      properties: [
        {
          property: 'application_start_date',
          value: req.body.applicationStartDate,
        },
        .....
      ],
    };
  }

  if (req.body.room) {
    requestBody.properties.push({
      property: 'info_session',
      value: `${req.body.room} ${req.body.date} ${req.body.time}`,
    });
  }
  requestBody.properties.push({
    property: 'email',
    value: req.body.userEmail,
  });

  hubspot.contacts
    .createOrUpdate(req.body.userEmail, requestBody)
    .then((results) => {
      res.send(results);
    })
    .catch((err) => {
      res.send(err);
    });
});

module.exports = router;

The one that I noticed with the consistent response ‘{“usageLimit”:5,“currentUsage”:5,“usagePercent”:100}’
was the hubspot_getlanded post.


#4

Hi @jasmis,

It looks like you’re using an API wrapper of some sort to make the requests. Is there a way for you to log & send me the actual request body/URL that’s being sent? The create or update endpoint isn’t associated with a portal’s sales professional seats, so I’m wondering if the API wrapper / library you’re using has somehow malformed the request url.


#5

@Derek_Gervais here is the CURL request of the request @jasmis is refering about?

curl 'http://localhost:3000/api/hubpost' -H 'Pragma: no-cache' -H 'Origin: http://localhost:3000' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9,ne;q=0.8,hi;q=0.7,nb;q=0.6,la;q=0.5' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.59 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Cache-Control: no-cache' -H 'Referer: http://localhost:3000/referral' -H 'Connection: keep-alive' --data-binary '{"firstname":"sdf","lastname":"sdf","company":"SDF Air Traffic Control Tower","address":"755 Grade Ln, Louisville, KY 40213, USA","persontype":"Customer","email":"sdfdsfd@fullmoond.com","lead_source":"facebook","priorityScore":3,"partnershipStatus":"N/A"}' --compressed