Where is APIKEY in new IDE


#1

I can’t find APIKEY in new ide.


#2

It’s intentionally not there. In the IDE, API keys are provided to support the Build API. The Build API is now deprecated; please use the impCentral API instead. The impCentral API does not use API keys.

For more information on using the impCentral API, here are all the details.


#3

I’m still confused by all of this. As a developer (I have development imps) and nothing in the way of factory imps, I can’t figure out if I have to do something to all of my imps or not? Example, I have an Imp003 that is collecting some data on a kiln in my garage. Do I have to put a bunch of code in the Agent to make it communicate with the API? Will it just stop working on Dec 4th?

If so, is there a tutorial somewhere that will walk us through on how to convert over? Not just instructions on how to use the APIs, but how to make my current imps continue to operate like they do now. The agent URL contains the imp ID, is that correct? Or will that all be gone? I’m not sure what I need to do.

The documentation still shows the “IDE” … or is that gone too? Or it’s called something else now?


#4

@mlseim Thanks for all the questions and let me answer them separately:

  • IDE vs impCentral - impCentral is the next-generation of IDE. impCentral not only provides you much more streamlined development environment and scalable device management, it also contains the most advanced features like flexible deployment and polite deployment. In the next month or so, you can use the migration wizard in impCentral to migrate your code and devices over from IDE. We will also migrate your code and device early February 2018 and after that IDE will be end-of-life.

  • API_KEY - As @smittytone mentioned, we no longer use API_KEY in impCentral and instead, there are 2 ways to authenticate yourself and Login Key is the closet to API_KEY. You can find more information, e.g. creating or removing one, in the impCentral API Doc.

  • Code Migration - You don’t need to convert your agent code in order for your devices to continue to work unless you have used Build API there. If your agent has been interacting with the Electric Imp platform using Build API, then the Porting Guide will help walk you through the concepts and conversions.

  • Agent URL - There are 3 different types of identifier to help you track a device and they are 1) Device ID, 2) Agent URL, and 3) MAC address. You can use any of them to identify your device in impCentral, and in fact, we made it even easier in impCentral, where you can lookup a device with its agentID and MAC address in addition to just Device ID.


#5

Generally speaking, no. Your imps and agents will continue to work just as they always have. Agent URLs will be unchanged.

You’ll only see a difference in the IDE, and your scripts (if any) will need to stop using the Build API (v4) and start using the impCentral API (v5).

If your agent uses the Build API (or any earlier version – I personally have at least one agent that talks to the v3 API cough), you’ll need to update that code. Otherwise, you have nothing to worry about.


#6

I’m trying to find more information on the Login Key and how to use them. All I could find was on the api doc on how to create/delete/manage but not the usages. Can you point me to resources/examples on this?

Many thanks,


#7

@kiwitech - Here is a simple python example which i hope helps.

import requests

def getAccessToken(login_key_id):
    url = "https://api.electricimp.com/v5/auth/token"
    data = { 'key': login_key_id }
    headers = {'Content-type': 'application/json'}
    response = requests.post(url, data=json.dumps(data), headers=headers)
    return response.json()['access_token']

def getDevice(access_token, device_id):
    url = "https://api.electricimp.com/v5/devices/" + device_id
    headers = {'Content-type': 'application/vnd.api+json', 'Authorization': 'Bearer ' + access_token}
    response = requests.get(url, headers=headers)
    return response.json()

access_token = getAccessToken("MY_LOGIN_KEY_ID")
device_json = getDevice(access_token, "MY_DEVICE_ID")

#8

That helps - thank you. Got it all working now :slight_smile:


#9

Glad I could help :slight_smile:


#10

@kiwitech - Do see Andrew’s comments about using Login Key’s.