Hello rikietje,
I have implemented my Post Request in PHP the same as you did in Python. The device registry and network server responses are fine but I am getting errors in joint and application servers post requests.
Response of data1
{
“ids”:{
“device_id”:“boden-07”,
“application_ids”:{
“application_id”:“boden-messung”
},
“dev_eui”:“647FDA0000006FC8”,
“join_eui”:“647FDA8010000100”
},
“created_at”:“2021-05-31T14:35:18.966Z”,
“updated_at”:“2021-05-31T14:35:18.966Z”,
“name”:“boden-07”,
“version_ids”{},
“network_server_address”:“eu1.cloud.thethings.network”,
“application_server_address”:“eu1.cloud.thethings.network”,
“join_server_address”:“eu1.cloud.thethings.network”
}
Response of data2
{
“code”:3,“message”:“error:pkg/rpcmiddleware/validator:field_mask_paths (forbidden path(s) in field mask)”,
“details” [{
“@type”:“type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
“namespace”:“pkg/rpcmiddleware/validator”,
“name”:“field_mask_paths”,
“message_format”:"forbidden
path(s) in field mask”,
“attributes”:{
“forbidden_paths”:[
“boden-07”,
“647FDA0000006FC8”,
“647FDA8010000100”,
“”,
“”,
“”,
“”,
“F8A9C76B75013D14873807577430FF73”
]
},
“correlation_id”:“95c4a05d3f2840b4be1827d6f0fe2c71”,
“code”:3
}
]
}
Response of data3
{
“ids”:{
“device_id”:“boden-07”,
“application_ids”:{
“application_id”:“boden-messung”
},
“dev_eui”:“647FDA0000006FC8”,
“join_eui”:“647FDA8010000100”
},
“created_at”:“2021-05-31T14:35:19.477465462Z”,
“updated_at”:“2021-05-31T14:35:19.477465462Z”
}
Response of data4
{
“code”:3,
“message”:“error:pkg/rpcmiddleware/validator:field_mask_paths (forbidden path(s) in field mask)”,
“details”:[{
"@type":“[type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
“namespace”:“pkg/rpcmiddleware/validator”,
“name”:“field_mask_paths”,
“message_format”:"forbidden
](http://type.googleapis.com/ttn.lorawan.v3.ErrorDetails%22,
%22namespace%22:%22pkg/rpcmiddleware/validator%22,
%22name%22:%22field_mask_paths%22,
%22message_format%22:%22forbidden) path(s) in field mask”,
“attributes”:{
“forbidden_paths”:[
“boden-07”,
“647FDA0000006FC8”,
“647FDA8010000100”
]
},
“correlation_id”:“2c93bda3a9654c5e987c5fff069d9007”,
“code”:3
}
]
}
This is the response to my all four post requests.
$url1 = 'https://eu1.cloud.thethings.network/api/v3/applications/'.$this->appId.'/devices';
$url2 = 'https://eu1.cloud.thethings.network/api/v3/js/applications/'.$this->appId.'/devices';
$url3 = 'https://eu1.cloud.thethings.network/api/v3/ns/applications/'.$this->appId.'/devices';
$url4 = 'https://eu1.cloud.thethings.network/api/v3/as/applications/'.$this->appId.'/devices';
The above are the four URLs.
The four JSON data (data1, data2, data3, data4) are the same as you implemented.
Can you please guide me a bit on why I am getting this forbidden field_mask_paths error. Thank you so much.
Kind regards
Imran Khan