{"_id":"551d0cc53c66970d00d20ba9","title":"Getting started","updates":["5bd16641e94089005c271bca"],"category":"551bfa0aefc11923006421c8","excerpt":"With the API you can work on your deals as well as be notified when something interesting happens in Lime Go.","githubsync":"","order":0,"version":"551bfa09efc11923006421c7","api":{"params":[],"results":{"codes":[]},"settings":"","url":"","auth":"required"},"hidden":false,"project":"551a5ee02cb8030d0085d31f","sync_unique":"","type":"basic","__v":16,"createdAt":"2015-04-02T09:32:53.243Z","link_external":false,"parentDoc":null,"slug":"getting-started","user":"551a5e432f1af40d00cff757","body":"#Notifications\nBy using the Lime Go API you can get notified when interesting things happens in your organization. You will for example get notified when a lead turns into a customer or when a deal is closed. When you get a notification the event will include information such as the deal's value or who closed the deal. You can get notified when an organization's relation changes or when a deal's status changes. \n\nThe API supports both a **push** and **pull** model. If you want to use push you must set up a subscription by POST /event/subscription and provide an URL where the API should send notifications.\n\nIf you use the pull model you should poll the FEED url at a regular interval.\n\nWe recommend that you use the push model.\n\n##Push\nWhen using the push model you should first create a subscription by POST to /event/subscribe. A  subscription has a target URL and a set of events that it want to subscribe to.\n\nWhen an event happens the Lime Go that is part of a subscription we will invoke the subscription's target URL. \n\nA subscription is identified by an Id. If you want to unsubscribe invoke DELETE /event/subscription with the id as argument.\n\n##Pull\nWhen using the pull model you must poll the Lime Go API at a regular interval for changes. \n\nWhen something happens in the application, items are added to a queue of events. When you invoke GET feed you will get the events in chronological order (ie oldest first). You will get 50 items on each request. When an item has been retrieved it can't be retrieved again. \nThis means that the feed's position is managed by the server and the client can invoke the URL with the same query parameters each time. \n\nYou can't move the feed's position backwards or forwards.\n\n#Working with deals and organizations\n\nYou can set the responsible coworker for deals and organization. It is also possible to update an organization's relation or a deal's status. Read the /graphql endpoint for details about how to do this.\n\nWith the /graphql endpoint you can also search for data in Lime Go.\n\n#Authentication\n\nIn order to use the API you must have an API key. You can generate an API key in Settings, Integrations, Lime Go API Keys.\n\nThe API key must be provided for all requests. It can be provided one of the the following ways:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Authorization type\",\n    \"h-1\": \"Descrption\",\n    \"0-0\": \"Header\",\n    \"1-0\": \"Query parameter\",\n    \"2-0\": \"Form\",\n    \"0-1\": \"The authorization header should be set according to:\\nAuthorization: go-api:<API_KEY>\",\n    \"1-1\": \"Set a query parameted named apikey to your key:\\napikey=<API_KEY>\",\n    \"2-1\": \"A hidden form variabled named apikey with the value of your API_KEY.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n#Content-Types \n\nThe API use json for all data. All request and response bodies should have Content-Type application/json. \n\nYou should set the Accept header to application/json or append .json on all requests.\n\n#URLs\n\nThe API is available at https://api.lime-go.com, \n(Note that you will be unauthorized if you do not send the key as above)","isReference":false,"link_url":"","next":{"description":"","pages":[]},"childrenPages":[]}

Getting started

With the API you can work on your deals as well as be notified when something interesting happens in Lime Go.

#Notifications By using the Lime Go API you can get notified when interesting things happens in your organization. You will for example get notified when a lead turns into a customer or when a deal is closed. When you get a notification the event will include information such as the deal's value or who closed the deal. You can get notified when an organization's relation changes or when a deal's status changes. The API supports both a **push** and **pull** model. If you want to use push you must set up a subscription by POST /event/subscription and provide an URL where the API should send notifications. If you use the pull model you should poll the FEED url at a regular interval. We recommend that you use the push model. ##Push When using the push model you should first create a subscription by POST to /event/subscribe. A subscription has a target URL and a set of events that it want to subscribe to. When an event happens the Lime Go that is part of a subscription we will invoke the subscription's target URL. A subscription is identified by an Id. If you want to unsubscribe invoke DELETE /event/subscription with the id as argument. ##Pull When using the pull model you must poll the Lime Go API at a regular interval for changes. When something happens in the application, items are added to a queue of events. When you invoke GET feed you will get the events in chronological order (ie oldest first). You will get 50 items on each request. When an item has been retrieved it can't be retrieved again. This means that the feed's position is managed by the server and the client can invoke the URL with the same query parameters each time. You can't move the feed's position backwards or forwards. #Working with deals and organizations You can set the responsible coworker for deals and organization. It is also possible to update an organization's relation or a deal's status. Read the /graphql endpoint for details about how to do this. With the /graphql endpoint you can also search for data in Lime Go. #Authentication In order to use the API you must have an API key. You can generate an API key in Settings, Integrations, Lime Go API Keys. The API key must be provided for all requests. It can be provided one of the the following ways: [block:parameters] { "data": { "h-0": "Authorization type", "h-1": "Descrption", "0-0": "Header", "1-0": "Query parameter", "2-0": "Form", "0-1": "The authorization header should be set according to:\nAuthorization: go-api:<API_KEY>", "1-1": "Set a query parameted named apikey to your key:\napikey=<API_KEY>", "2-1": "A hidden form variabled named apikey with the value of your API_KEY." }, "cols": 2, "rows": 3 } [/block] #Content-Types The API use json for all data. All request and response bodies should have Content-Type application/json. You should set the Accept header to application/json or append .json on all requests. #URLs The API is available at https://api.lime-go.com, (Note that you will be unauthorized if you do not send the key as above)