API

REST API for StartupCRM : Available commands documentation & examples



Introduction


The Startup CRM API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. A token is bound to a whole Startup CRM installation. To interact with the API of another Startup CRM's installation, you have to create a new token inside this installation.

Create your API token


Step 1) Sign in into Startup's CRM backend as an admin, go to API → API Management, and create a new token. Make sure to copy the token and that you fill all necessary information.

Usage of the API


Available commands of the API are described below, along with their responses.

For this example, we will use a dummy token and a random command.

Let’s say your new token is
jEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztX and that you need to list all available customers of the Startup CRM's installation, using the API, through a cURL request.

Command Request


curl -H "authtoken: jEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztX" https://mysite.com/api/customers

Response of command request


[
   {
      "stripe_id" : null,
      "active" : "1",
      "vat" : "1234567890",
      "address" : "Test Address",
      "billing_country" : "0",
      "phonenumber" : "1234567890",
      "registration_confirmed" : "1",
      "longitude" : null,
      "billing_city" : "",
      "state" : "Test State",
      "shipping_zip" : "",
      "billing_zip" : "",
      "city" : "Test City",
      "shipping_country" : "0",
      "billing_street" : "",
      "datecreated" : "2019-11-29 12:34:56",
      "company" : "Jk Technologies",
      "shipping_street" : "",
      "zip" : "123456",
      "billing_state" : "",
      "leadid" : null,
      "addedfrom" : "8",
      "userid" : "3",
      "default_language" : "english",
      "shipping_state" : "",
      "show_primary_contact" : "0",
      "country" : "102",
      "default_currency" : "3",
      "shipping_city" : "",
      "latitude" : null,
      "website" : "https://jkdot.com"
   },
   {
      "website" : "https://www.test.com",
      "latitude" : null,
      "default_currency" : "0",
      "shipping_city" : "London",
      "country" : "235",
      "show_primary_contact" : "0",
      "shipping_state" : "Greater London",
      "default_language" : "",
      "addedfrom" : "1",
      "userid" : "1",
      "leadid" : null,
      "billing_state" : "Greater London",
      "zip" : "WC1 ASW",
      "shipping_street" : "123 Road Street",
      "company" : "Sample Company LTD",
      "datecreated" : "2019-04-02 13:38:28",
      "billing_street" : "123 Road Street",
      "shipping_country" : "235",
      "city" : "London",
      "billing_zip" : "WC1 ASW",
      "shipping_zip" : "WC1 ASW",
      "longitude" : null,
      "registration_confirmed" : "1",
      "billing_city" : "London",
      "state" : "Greater London",
      "phonenumber" : "+44 210 7298299",
      "billing_country" : "235",
      "address" : "123 Road Street",
      "vat" : "123456789",
      "active" : "1",
      "stripe_id" : null
   }
]

End of documentation intro part. Below, you will find all available commands that can be used with Rest API of Startup CRM, along with their methods.


Customer

Customer - Add New Customer

0.0.0 
POST
api/customers

Header

Champ Type Description
authtoken String

Basic Access Authentication token.

Paramètre

Champ Type Description
company String

Mandatory Customer company.

vatoptionnel String

Optional Vat.

phonenumberoptionnel String

Optional Customer Phone.

websiteoptionnel String

Optional Customer Website.

groups_inoptionnel Number[]

Optional Customer groups.

default_languageoptionnel String

Optional Customer Default Language.

default_currencyoptionnel String

Optional default currency.

addressoptionnel String

Optional Customer address.

cityoptionnel String

Optional Customer City.

stateoptionnel String

Optional Customer state.

zipoptionnel String

Optional Zip Code.

countryoptionnel String

Optional country.

billing_streetoptionnel String

Optional Billing Address: Street.

billing_cityoptionnel String

Optional Billing Address: City.

billing_stateoptionnel Number

Optional Billing Address: State.

billing_zipoptionnel String

Optional Billing Address: Zip.

billing_countryoptionnel String

Optional Billing Address: Country.

shipping_streetoptionnel String

Optional Shipping Address: Street.

shipping_cityoptionnel String

Optional Shipping Address: City.

shipping_stateoptionnel String

Optional Shipping Address: State.

shipping_zipoptionnel String

Optional Shipping Address: Zip.

shipping_countryoptionnel String

Optional Shipping Address: Country.

array (size=22)
  'company' => string 'Kakuz' (length=38)
  'vat' => string '123456789' (length=9)
  'phonenumber' => string '123456789' (length=9)
  'website' => string 'AAA.com' (length=7)
  'groups_in' => 
    array (size=2)
      0 => string '1' (length=1)
      1 => string '4' (length=1)
  'default_currency' => string '3' (length=1)
  'default_language' => string 'english' (length=7)
  'address' => string '1 Silk Point' (length=12)
  'city' => string 'John Test' (length=9)
  'state' => string 'John Test' (length=9)
  'zip' => string '700000' (length=6)
  'country' => string '243' (length=3)
  'billing_street' => string '1 Silk Point' (length=12)
  'billing_city' => string 'John Test' (length=9)
  'billing_state' => string 'John Test' (length=9)
  'billing_zip' => string '700000' (length=6)
  'billing_country' => string '243' (length=3)
  'shipping_street' => string '1 Silk Point' (length=12)
  'shipping_city' => string 'John Test' (length=9)
  'shipping_state' => string 'John Test' (length=9)
  'shipping_zip' => string '700000' (length=6)
  'shipping_country' => string '243' (length=3)

Success 200

Champ Type Description
status Boolean

Request status.

message String

Customer add successful.

HTTP/1.1 200 OK
{
  "status": true,
  "message": "Customer add successful."
}

Error 4xx

Nom Type Description
status Boolean

Request status.

message String

Customer add fail.

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Customer add fail."
}

Customer - Delete a Customer

0.0.0 
DELETE
api/delete/customers/:id

Header

Champ Type Description
authtoken String

Basic Access Authentication token.

Paramètre

Champ Type Description
id Number

Customer unique ID.

Success 200

Champ Type Description
status String

Request status.

message String

Customer Delete Successful.

HTTP/1.1 200 OK
{
  "status": true,
  "message": "Customer Delete Successful."
}

Error 4xx

Nom Type Description
status Boolean

Request status.

message String

Customer Delete Fail.

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Customer Delete Fail."
}

Customer - Request customer information

0.0.0 
GET
api/customers/:id

Header

Champ Type Description
authtoken String

Basic Access Authentication token.

Paramètre

Champ Type Description
id Number

customer unique ID.

Success 200

Champ Type Description
customer Object

information.

HTTP/1.1 200 OK
{
     "id": "28",
     "name": "Test1",
     "description": null,
     "status": "1",
     "clientid": "11",
     "billing_type": "3",
     "start_date": "2019-04-19",
     "deadline": "2019-08-30",
     "customer_created": "2019-07-16",
     "date_finished": null,
     "progress": "0",
     "progress_from_tasks": "1",
     "customer_cost": "0.00",
     "customer_rate_per_hour": "0.00",
     "estimated_hours": "0.00",
     "addedfrom": "5",
     "rel_type": "customer",
     "potential_revenue": "0.00",
     "potential_margin": "0.00",
     "external": "E",
    ...
}

Error 4xx

Nom Type Description
status Boolean

Request status.

message String

No data were found.

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "No data were found"
}

Customer - Search Customer Information.

0.0.0 
GET
api/customers/search/:keysearch

Header

Champ Type Description
authtoken String

Basic Access Authentication token.

Paramètre

Champ Type Description
keysearch String

Search Keywords.

Success 200

Champ Type Description
customer Object

information.

HTTP/1.1 200 OK
{
     "id": "28",
     "name": "Test1",
     "description": null,
     "status": "1",
     "clientid": "11",
     "billing_type": "3",
     "start_date": "2019-04-19",
     "deadline": "2019-08-30",
     "customer_created": "2019-07-16",
     "date_finished": null,
     "progress": "0",
     "progress_from_tasks": "1",
     "customer_cost": "0.00",
     "customer_rate_per_hour": "0.00",
     "estimated_hours": "0.00",
     "addedfrom": "5",
     "rel_type": "customer",
     "potential_revenue": "0.00",
     "potential_margin": "0.00",
     "external": "E",
    ...
}

Error 4xx

Nom Type Description
status Boolean

Request status.

message String

No data were found.

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "No data were found"
}

Customer - Update a Customer

0.0.0 
PUT
api/customers/:id

Header

Champ Type Description
authtoken String

Basic Access Authentication token.

Paramètre

Champ Type Description
company String

Mandatory Customer company.

vatoptionnel String

Optional Vat.

phonenumberoptionnel String

Optional Customer Phone.

websiteoptionnel String

Optional Customer Website.

groups_inoptionnel Number[]

Optional Customer groups.

default_languageoptionnel String

Optional Customer Default Language.

default_currencyoptionnel String

Optional default currency.

addressoptionnel String

Optional Customer address.

cityoptionnel String

Optional Customer City.

stateoptionnel String

Optional Customer state.

zipoptionnel String

Optional Zip Code.

countryoptionnel String

Optional country.

billing_streetoptionnel String

Optional Billing Address: Street.

billing_cityoptionnel String

Optional Billing Address: City.

billing_stateoptionnel Number

Optional Billing Address: State.

billing_zipoptionnel String

Optional Billing Address: Zip.

billing_countryoptionnel String

Optional Billing Address: Country.

shipping_streetoptionnel String

Optional Shipping Address: Street.

shipping_cityoptionnel String

Optional Shipping Address: City.

shipping_stateoptionnel String

Optional Shipping Address: State.

shipping_zipoptionnel String

Optional Shipping Address: Zip.

shipping_countryoptionnel String

Optional Shipping Address: Country.

{
    "company": "Kakuz",
    "vat": "",
    "phonenumber": "0123456789",
    "website": "",
    "default_language": "",
    "default_currency": "0",
    "country": "243",
    "city": "Paris",
    "zip": "700000",
    "state": "Quận 12",
    "address": "1 rue",
    "billing_street": "1 rue",
    "billing_city": "Paris",
    "billing_state": "Quận 12",
    "billing_zip": "700000",
    "billing_country": "143",
    "shipping_street": "",
    "shipping_city": "",
    "shipping_state": "",
    "shipping_zip": "",
    "shipping_country": "0"
}

Success 200

Champ Type Description
status Boolean

Request status.

message String

Customer Update Successful.

HTTP/1.1 200 OK
{
  "status": true,
  "message": "Customer Update Successful."
}

Error 4xx

Nom Type Description
status Boolean

Request status.

message String

Customer Update Fail.

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Customer Update Fail."
}

Lead

Lead - Add New Lead

0.0.0 
POST
api/leads

Header

Champ Type Description
authtoken String

Basic Access Authentication token.

Paramètre

Champ Type Description
source String

Mandatory Lead source.

status String

Mandatory Lead Status.

name String

Mandatory Lead Name.

file[]optionnel File

Optional Lead attachments.

assignedoptionnel String

Optional Lead assigned.

tagsoptionnel String

Optional Lead tags.

titleoptionnel String

Optional Position.

emailoptionnel String

Optional Lead Email Address.

websiteoptionnel String

Optional Lead Website.

phonenumberoptionnel String

Optional Lead Phone.

companyoptionnel String

Optional Lead company.

addressoptionnel String

Optional Lead address.

cityoptionnel String

Optional Lead City.

stateoptionnel String

Optional Lead state.

countryoptionnel String

Optional Lead Country.

default_languageoptionnel String

Optional Lead Default Language.

descriptionoptionnel String

Optional Lead description.

custom_contact_dateoptionnel String

Optional Lead From Customer.

contacted_todayoptionnel String

Optional Lead Contacted Today.

is_publicoptionnel String

Optional Lead google sheet id.

array (size=20)
   'status' => string '2' (length=1)
   'source' => string '6' (length=1)
   'assigned' => string '1' (length=1)
   'client_id' => string '5' (length=1)
   'tags' => string '' (length=0)
   'name' => string 'Lead Name' (length=9)
   'contact' => string 'Contact A' (length=9)
   'title' => string 'Position A' (length=10)
   'email' => string '[email protected]' (length=13)
   'website' => string '' (length=0)
   'phonenumber' => string '123456789' (length=9)
   'company' => string 'TheCompany' (length=51)
   'address' => string '1 Silk Point' (length=53)
   'city' => string 'John Test' (length=9)
   'state' => string '' (length=0)
   'default_language' => string 'english' (length=10)
   'description' => string 'Description' (length=11)
   'custom_contact_date' => string '' (length=0)
   'is_public' => string 'on' (length=2)
   'contacted_today' => string 'on' (length=2)

Success 200

Champ Type Description
status Boolean

Request status.

message String

Lead add successful.

HTTP/1.1 200 OK
{
  "status": true,
  "message": "Lead add successful."
}

Error 4xx

Nom Type Description
status Boolean

Request status.

message String

add fail.

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Lead add fail."
}

Lead - Delete a Lead

0.0.0 
DELETE
api/delete/leads/:id

Header

Champ Type Description
authtoken String

Basic Access Authentication token.

Paramètre

Champ Type Description
id Number

lead unique ID.

Success 200

Champ Type Description
status String

Request status.

message String

Lead Delete Successful.

Avez-vous trouvé cet article utile ?