Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Community Manager
1,629 Views

REST API - C intel edison submitdata error 1404

Hi guys,

I'm trying to use C- API to access at rest service of intel iot cloud.

When I try to submit data with

response_temperature = submitData("temperature", "26.15");

printf("Response Received :%s\n", response_temperature);

Server response is:

Response Received :{"code":404,"data":{"code":1404,"message":"Device not found in IoT cloud. Try initializing and activating the device once again."}}

The url generated from submitData is:

https://dashboard.us.enableiot.com/v1/api/data/02-00-86-9f-0d-3b

with body

body: {"on":1471383109000,"accountId":"f4b1e5f2XXXXXXXXXXXXXXX","data":[{"componentId":"temperature.v1.0","on":1471383109000,"value":"26.15"}]}

In accord with https://github.com/enableiot/iotkit-api/wiki/Data-API Data API · enableiot/iotkit-api Wiki · GitHub

The device results activated and the proof is that :

isActivated = isDeviceActivated();

return true both before and after submitData.

Can anyone help me?

Thanks a lot.

0 Kudos
3 Replies
Highlighted
Community Manager
14 Views

Hi Vale,

 

 

Could you please share all the steps that you're following? I would like to take a look at the process to see if I can reproduce the issue, so every detail will be of help.

 

I would also suggest you to check these two links:

 

http://www.programmableweb.com/news/how-to-add-restful-api-to-intel-edison-and-work-it/sponsored-con... http://www.programmableweb.com/news/how-to-add-restful-api-to-intel-edison-and-work-it/sponsored-con...

 

https://thedrunkendeveloper.wordpress.com/2015/02/15/rest-easy-an-edison-project/ https://thedrunkendeveloper.wordpress.com/2015/02/15/rest-easy-an-edison-project/

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
Community Manager
14 Views

Hi ,

 

Thanks for your help, but I have already solved: after creating the component, I used the "add component" function, then with "submit data" function I sent data on IoT cloud and it seems to work! The code is the following:`char *response_comp=NULL;  ComponentCatalog *cmpObject = createComponentCatalogObject("temper", "1.0", "sensor", Number", "float", "Degrees Celsius", "timeSeries");  addMinValue(cmpObject, -150.0f);  addMaxValue(cmpObject, 150.0f);   response_comp = createAnComponentCatalog(cmpObject);  char *response = NULL; response = listAllComponentCatalogs();  char *response_problema = NULL;  response_problema = addComponent("temper", "temperature.v1.0");  char *response_temperature;  response_temperature = submitData("temper", "26");`

0 Kudos
Highlighted
Community Manager
14 Views

Hi Vale,

I'm really happy to know that you made it work . Let us know if you have any other question in the future questions and we will help you.

Regards,

 

-Pablo
0 Kudos