Getting started

API version 1.0
Thursday, 22 of April 2021

Introduction

The purpose of this section is to show how to do a basic REST access using RepCamp API. Repcamp Api provides a set of REST services that allow the following actions: 

  • Acces the main objects of RepCamp: Customer, Product, Categories, Manufacturer, Order, Pricelist, PricelistLine

  • Perform bulk insert operations so you can upload large collections of objects in a single API call.

  • Execute CRUD actions (delete, update, retrieve and add) to maintain remotely your data in the cloud.

How to do a simple Call

Create a RepCamp Account

In order to take advantage of the API, you have to own a subscrition of RepCamp. The free version offers 30 days of full access in order to test all the features of Repcamp including the access to the API. Once the trial period ends you have to upgrade your subscrition from free to professional to unlock the API access again.

 

Register form
Upgrade subscription area

Generate a developer key

In order to call an API resource, is necessary to obtain an API KEY and a secret KEY associated to a contract. To obtain the keys, you have to access RepCamp with your user and password and access the manage subscrition area. At the bottom of the page you will find the key generation form. 

https://api.repcamp.com/apikey/generate

Sample Api Key/Secret Key generated

API KEY
cc0aa9e38fcc529fff5393078ab4a8cb
SECRET KEY
b6ec1f77f73f0cb3937a3833aa948d9226e23532a0b5aaafd5b113c01142ad5c
 

Repcamp Rest Service Request

 

STEP 1:GET authtoken

https://api.repcamp.com/authtoken

Headers

Parameter Required? Description
api-key Yes API KEY linked to a repcamp contract
cc0aa9e38fcc529fff5393078ab4a8cb
Authorization Yes Basic auth
User/password of a repcamp user with the necessary rights to access the resources of a specific contract linked to an API KEY

Example Response

{
    "accesstoken": "5357a2acd5a0399c36000001",
    "expires": "60s"
}

 

STEP 2. Call a resource

https://api.repcamp.com/v1/customers

Headers

Parameter Required? Description
api-token Yes API TOKEN. HMAC encryption of the token retrieved in the first step using the secret key and SHA-1
accesstoken: 5357a2acd5a0399c36000001
secret key: b6ec1f77f73f0cb3937a3833aa948d9226e23532a0b5aaafd5b113c01142ad5c
api-token: 2a99713e60c3e040439a0b31bc97fa34e660abc1

 

Example Response


[
{
"__v": 1,
"_id": "54b8f7d6bffd08381f0001a0",
"address": "27-29 King's Hill",
"city": "Westport",
"code": "0008",
"comercial_name": "Ár Frames",
"contract": "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
"country": "IRLANDA",
"created_at": "2015-01-16T11:36:54.913Z",
"discount": 0,
"email": "orders@arframes.com",
"fiscal_name": "West Frames Ltd.",
"latitude": 0,
"longitude": 0,
"payment_method": "Bank Transfer 30 days",
"state": "Co. Mayo",
"telephone": "+353 98 55132",
"updated_at": "2015-01-16T20:00:38.805Z",
"vat_number": "D34591276",
"zip": "M004841",
"reps": [
{
"user": "54760688beb6f42c15000078",
"_id": "54b8f7d6bffd08381f0001a1",
"assigned_at": "2015-01-15T20:37:00.821Z"
},
{
"user": "54760688beb6f42c15000078",
"_id": "54b96de6bffd08381f0001e6",
"assigned_at": "2015-01-15T20:37:00.821Z"
}
],
"language": "en",
"status": 1
},
{
"__v": 1,
"_id": "54b8f7d6bffd08381f0001a6",
"address": "Av. Onze de Setembre, 150",
"city": "Cabrera de Mar",
"code": "0005",
"comercial_name": "La Siesta Company",
"contract": "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
"country": "ESPAÑA",
"created_at": "2015-01-16T11:36:54.929Z",
"discount": 0,
"email": "marcos@siestaco.com",
"fiscal_name": "Siesta hermanos S.L.",
"latitude": 41.5280545,
"longitude": 2.3929959,
"payment_method": "Recibo 30 dias",
"state": "BARCELONA",
"telephone": "937840551",
"updated_at": "2015-01-16T20:00:38.821Z",
"vat_number": "N29347198",
"zip": "08349",
"reps": [
{
"user": "54760688beb6f42c15000078",
"_id": "54b8f7d6bffd08381f0001a7",
"assigned_at": "2015-01-15T20:37:00.821Z"
},
{
"user": "54760688beb6f42c15000078",
"_id": "54b96de6bffd08381f0001e9",
"assigned_at": "2015-01-15T20:37:00.821Z"
}
],
"language": "es",
"status": 1
}]