Hi,
how to add new remote modality through restAPI without editing/touching orthanc.config file.
in above rest api, we can only modify remote modality.
is there any possible way-out to add new remote modality through rest API.
Thanks.
Hi,
how to add new remote modality through restAPI without editing/touching orthanc.config file.
in above rest api, we can only modify remote modality.
is there any possible way-out to add new remote modality through rest API.
Thanks.
Hi,
You can create and update Modalities through the REST Api. The documentation to do that is https://api.orthanc-server.com/#tag/Networking/paths/~1modalities~1{id}/put
Hope that helps.
James
Hi,
I have tried the following command to create new modality.
curl -v -X PUT http://localhost:8042/modalities/sample -d ‘{“AET” : “ORTHANCC”, “Host”: “127.0.0.1”, “Port”: 2002}’
I am getting the following error
PUT /modalities/sample HTTP/1.1
Host: localhost:8042
User-Agent: curl/7.55.1
Accept: /
Content-Length: 5
Content-Type: application/x-www-form-urlencoded
I am new to using Orthanc. Please help me to resolve this issue.
Thanks,
Narsimha
Hello,
Your command works properly with Orthanc 1.9.2:
$ curl -v -X PUT http://localhost:8042/modalities/sample -d ‘{“AET” : “ORTHANCC”, “Host”: “127.0.0.1”, “Port”: 2002}’
[…]
< HTTP/1.1 200 OK
Make sure to upgrade your version of Orthanc.
Sébastien-
Thank you for your quick response. I am using the following version
{
"ApiVersion" : 12,
"CheckRevisions" : false,
"DatabaseBackendPlugin" : null,
"DatabaseVersion" : 6,
"DicomAet" : "ORTHANC",
"DicomPort" : 4242,
"HttpPort" : 8042,
"IsHttpServerSecure" : true,
"Name" : "MyOrthanc",
"PluginsEnabled" : true,
"StorageAreaPlugin" : null,
"Version" : "1.9.2"
}
Thanks,
Narsimha
This is the same configuration as mine.
Here is how I start Orthanc:
$ docker run --rm -t -i -p 8042:8042 jodogne/orthanc:1.9.2
And here is the result of your command:
$ curl -u orthanc:orthanc -v -X PUT http://localhost:8042/modalities/sample -d ‘{“AET” : “ORTHANCC”, “Host”: “127.0.0.1”, “Port”: 2002}’
As can be seen, everything works properly. You are most probably mixing different versions of Orthanc. In either case, I cannot provide any further support:
https://book.orthanc-server.com/users/support.html#discussing-a-minimal-working-example
Sébastien-
Narsimha, you are damaging the Orthanc bug tracker by reproducing this question on an issue that is by no way not related to your question. I had to disable your account on the bug tracker for this reason.
I have already posted two answers above. Continue to discuss your question on this thread, as explained in the Orthanc Book:
https://book.orthanc-server.com/users/support.html#using-the-bug-tracker
Hi ,
I apologize for the mistake. Please refer the following steps
PUT /modalities/sample HTTP/1.1
Host: localhost:8042
User-Agent: curl/7.55.1
Accept: /
Content-Length: 5
Content-Type: application/x-www-form-urlencoded
Thanks,
Narsimha
This is a question related to Windows system administration.
Indeed, the basic Windows prompt doesn’t support single quotes and thus requires escaping:
https://groups.google.com/g/orthanc-users/c/hKIcotiOlnA/m/xC-XGw3SHgAJ
Replace single quotes by double quotes, and prefix double quotes by a backslash character. The following syntax should work (untested, as I don’t use proprietary software):
$ curl -v -X PUT http://localhost:8042/modalities/sample -d “{"AET" : "ORTHANCC", "Host": "127.0.0.1", "Port": 2002}”
Sébastien-
Thank you so much. It is resolved.
Thanks,
Narsimha