# Welcome!

Thank you for deciding to read the Salescamp API Reference!

Our API is designed to make it easy to interact with the data inside of Salescamp using automated systems.

We have tried to make the Salescamp API as friendly as possible to developers by using standard [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer) conventions and [JSON](http://www.json.org/) responses.

## Developer Support

As Developers we understand that no API Reference can answer every question.

We have a Developer to Developer support system where if you are working with our API you can immediately speak directly to one of our Engineers.

If you have a question about our API just start a conversation with us using the chat widget on this page and your query will be sent to a member of our engineering team!


# Authentication

## Get your API keys

**`"<https://api.salescamp.app/token>"`**

The Salescamp API uses API keys to identify and authorise calls to the developer API.

These tokens are managed through the Workspace Admin settings inside the Salescamp product.

Your API keys are able to authenticate to Salescamp and perform actions on your account so it's important that you keep them safe in the same way that you would a password.

We accept both Bearer and Basic HTTP Authentication. We recommend using Bearer Authentication.

If you are using HTTP Basic Authentication you should provide your API key as the Basic Authentication username. You can safely leave the password blank.

If you are using HTTP Bearer Authentication you should provide your API key in the Authorization header as the Bearer value.

To keep your API key secure you should always connect to the Salescamp API using HTTPS.

## Scope

We group endpoints into families of similar endpoints that we refer to as Scopes.

When creating a token you will need to select which scopes you want the token to possess.

A token can only be used on the endpoints which it has been scoped for. Attempting to use an insufficiently scoped token will result in an Authorization error.


# Errors

The Salescamp API builds on top of HTTP Status Codes to show errors to developers.

Where appropriate the API will include a detailed error message explaining the nature of the issue and how it can be resolved.

### **Client Errors**

These errors are the result of an error on the side of the developer and will need to be addressed in your own code.

We will normally include further information to help resolve the error in the JSON body of the response.

<table><thead><tr><th width="166.34908136482937">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>400</td><td>The input provided to the method was invalid. The response body will contain more details to help resolve the issue.</td></tr><tr><td>401</td><td>The token provided was not accepted. This could be because the token has been revoked or is incorrectly formatted.</td></tr><tr><td>402</td><td>The workspace this token is connected to does not have an active subscription.</td></tr><tr><td>403</td><td>The token provided is not authorized for the scope required. The response body will contain details including the scope that was missing.</td></tr><tr><td>404</td><td>The resource requested could not be found.</td></tr><tr><td>429</td><td>The IP address making the request has exceeded our rate limits. The request should be retried in a few minutes.</td></tr></tbody></table>

###

### **Server Errors**

These errors indicate that something went wrong in our systems.

Errors of this category will automatically trigger notifications to our team and we'll start working behind the scenes to address the issue.

| Error Code | Description                                                                                                                                   |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| 500        | An error occurred processing the request. This is normally an application error and will not be solved by retrying the request.               |
| 503        | Our servers are too busy to handle the request. This issue is normally temporary and will be solved by retrying the request in a few minutes. |


# Versioning

Our APIs are versioned so that we can continue to safely improve our APIs without affecting your existing code.

When we release updates to our API we will do so, where possible, in a backwards compatible way so that implementations relying on functionality of the API version do not need to be upgraded.

If we ship a change to our APIs that is not backwards compatible we will do so by releasing a new major version of the API such that the old version continues to work as originally described.

Rarely, we might need to remove an old version of the API entirely. Whilst we will try not to do that we will always notify the Administrators of any accounts that have used the deprecated APIs in the 30 days leading up to the deprecation.

### **Historic Documentation**

We only provide documentation for the most recent version of our endpoints.

If you need to access information relating to a previous version of the endpoint please contact us at <sanjay@salescamp.app>


# Rate Limiting

As a multi-tenant service provider we place restrictions on the amount of requests that a single client can generate in order to provide a high quality of service to all of our customers.

By default, we apply a rate limit of 1000 requests per minute.

If your client exceeds this threshold it will be unable to make further requests until the rate limit resets.

When a rate limit is activated you will receive a **`429 Too Many Requests`** response.

We also include a **`Retry-After`** Header in our response. The Header's value is the number of seconds remaining until the rate limit resets and can be used to perform load management in your client side code.


# Token Metadata

### **Show Current Token**

> Example Request

**`https://api.salescamp.app/token`**

> Example Response (Status Code 200)

```
{
    "id": "61d8165ffc13ae680c000000",
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0IiwibmFtZSI6IkpvaG4iLCJpYXQiOjE1MTYyMzU3MDIyfQ.S7LQBCQRHOhghLYdu7eqTNGRANMQQNNMvIRV6TrWetc"
    "expires_in": 1296000,
    "given_name": "Ashli",
    "email": "acanfield0@yahoo.com",
    "user_created_on": 1502255738,
    "profile_photo": "https://picsum.photos/200"
    "phone": "+323-264-8091"
}
```

Retrieve information about the token being used and the Workspace to which it belongs.

#### **Required Scopes**

This endpoint does not require any scopes.

#### **HTTP Request**

#### **Request Path**

**`GET <https://api.salescamp.app/token`**>

#### **HTTP Response**

#### **Status Code - 200**

<details>

<summary>Optional object</summary>

**id :** Required \[ **string ]**

The Resource ID of the Current Token

**workspace:** Required \[**object]**

An object containing information about the Workspace that the Token belongs to

</details>


# API Reference

Dive into the specifics of each API endpoint by checking out our complete documentation.

## Pets

Items indicates any contact, company or deals.

{% content-ref url="/pages/i9xRRcf2ob22dWAIm6zt" %}
[Items](/reference/api-reference/items)
{% endcontent-ref %}

## Users

Everything related to users:

{% content-ref url="/pages/q30B62eAIVhIZW47oBLv" %}
[Activity](/reference/api-reference/activity)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** Using the 'Page Link' block lets you link directly to a page. If this page's name, URL or parent location changes, the reference will be kept up to date. You can also mention a page – like [Items](/reference/api-reference/items) – if you don't want a block-level link.
{% endhint %}


# Items

Items indicates any contact, company or deals.

### Get an Item

## Get an item from collection

<mark style="color:blue;">`GET`</mark> `https://api.salescamp.app/v1/collections/{{collection_id}}/items/{{item_id}}`

#### Query Parameters

| Name                                             | Type   | Description                    |
| ------------------------------------------------ | ------ | ------------------------------ |
| collection\_id<mark style="color:red;">\*</mark> | String | Resource ID of the Collection. |
| item\_id<mark style="color:red;">\*</mark>       | String | Resource ID of the item.       |

#### Headers

| Name                                                               | Type   | Description                      |
| ------------------------------------------------------------------ | ------ | -------------------------------- |
| Authorization                   <mark style="color:red;">\*</mark> | Bearer | PLACE\_SALESCAMP\_API\_KEY\_HERE |

### Create a new item

## Create item

<mark style="color:green;">`POST`</mark> `https://api.salescamp.app/v1/collections/{{collection_id}}/items`

Creates a new pet.

#### Query Parameters

| Name                                            | Type   | Description                    |
| ----------------------------------------------- | ------ | ------------------------------ |
| colection\_id<mark style="color:red;">\*</mark> | string | Resource ID of the Collection. |

#### Headers

| Name                                            | Type   | Description                      |
| ----------------------------------------------- | ------ | -------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer | PLACE\_SALESCAMP\_API\_KEY\_HERE |

{% tabs %}
{% tab title="200 Pet successfully created" %}

```javascript
{
    "firstname": "Paule",
    "lastname": "Jillings",
    "phone": "841 693 9818",
    "email": "pjillingsb@soundcloud.com",
    "status": "Bad Fit",
    "company_name": "Shuffletag",
    "job_title": "Marketing Head",
    "source": "Call",
    "next_follow_up_date": "2022-02-27T16:56:51Z",
    "email_opted_out": false,
    "description": "In congue. Etiam justo. Etiam pretium iaculis justo. In hac habitasse platea dictumst. Etiam faucibus cursus urna. Ut tellus. Nulla ut erat id mauris vulputate elementum. Nullam varius. Nulla facilisi.",
    "url": "https://shinystat.com",
    "twitter": "http://twitter.com/paule.jillings97",
    "google_plus": "https://plus.google.com/paule.j",
    "facebook": "www.facebook.com/paule_jillings",
    "city": "Novosibirsk",
    "country": "Russia"
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

### Update an Item&#x20;

## Update an existing item&#x20;

<mark style="color:orange;">`PUT`</mark> `https://api.salescamp.app/v1/collections/{{collection_id}}/items/{{item_id}}`

#### Query Parameters

| Name                                             | Type   | Description                    |
| ------------------------------------------------ | ------ | ------------------------------ |
| item\_id<mark style="color:red;">\*</mark>       | String | Resource ID of the Item        |
| collection\_id<mark style="color:red;">\*</mark> | String | Resource ID of the Collection. |

#### Headers

| Name                                                               | Type   | Description                      |
| ------------------------------------------------------------------ | ------ | -------------------------------- |
| Authorization                   <mark style="color:red;">\*</mark> | Bearer | PLACE\_SALESCAMP\_API\_KEY\_HERE |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "firstname": "Mellisent",
    "phone": "321-877-9195",
    "email": "mcreaser0@who.int",
    "status": "Customer",
    "lastname": "Creaser",
    "company_name": "Tagtune",
    "job_title": "Professor",
    "source": "Call",
    "next_follow_up_date": "2021-04-06T19:17:16Z",
    "email_opted_out": true,
    "url": "https:///morbi/vestibulum.aspx",
    "join_date": "2021-11-26T13:30:43Z",
    "alternate_phone": "754-674-5796",
    "city": "Dromiskin",
    "state": "Ireland",
    "country": "Russia",
    "postal_code": "167032"
}
```

{% endtab %}
{% endtabs %}


# Activity

### Add Activity

## Add activity in item, Ex.  Add notes, Meeting etc.&#x20;

<mark style="color:green;">`POST`</mark> `https://api.salescamp.app/v1/collections/{{collection_id}}/items/{{item_id}}/activities`

#### Query Parameters

| Name           | Type   | Description |
| -------------- | ------ | ----------- |
| collection\_id | String |             |
| item\_id       | String |             |

#### Headers

| Name          | Type   | Description                      |
| ------------- | ------ | -------------------------------- |
| Authorization | Bearer | PLACE\_SALESCAMP\_API\_KEY\_HERE |

#### Request Body

| Name        | Type   | Description                                        |
| ----------- | ------ | -------------------------------------------------- |
| action      | String | Can be id of activity, ex. note, meeting, call-log |
| title       | String |                                                    |
| Description | String |                                                    |
| date        | String |                                                    |
| Time        | String |                                                    |


