# REST API  receiving association failed

**URL:** https://discourse.orthanc-server.org/t/rest-api-receiving-association-failed/275
**Category:** Google Groups archive
**Created:** [September 20, 2015, 10:16pm UTC](https://discourse.orthanc-server.org/t/rest-api-receiving-association-failed/275 "2015-09-20T22:16:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ilya](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/i/58f4c7/32.png) [@Ilya](https://discourse.orthanc-server.org/u/Ilya)
#### Post date: [September 20, 2015, 10:16pm UTC](https://discourse.orthanc-server.org/t/rest-api-receiving-association-failed/275/1 "2015-09-20T22:16:16Z")

</div>

My config file.

{  
“Name” : “Orthanc”,  
“StorageDirectory” : “/var/lib/orthanc/db-v3”,  
“IndexDirectory” : “/var/lib/orthanc/db-v3”,  
“StorageCompression” : true,  
“MaximumStorageSize” : 0,  
“MaximumPatientCount” : 0,  
“LuaScripts” : [  
],  
“Plugins” : [  
“/etc/orthanc/orthancwebbuild/libOrthancWebViewer.so”  
],  
“HttpServerEnable” : true,  
“HttpPort” : 8000,  
“HttpDescribeErrors” : true,  
“HttpCompressionEnable” : true,  
“DicomServerEnable” : true,  
“DicomAet” : “ORTHANC”,  
“DicomCheckCalledAet” : false,  
“DicomPort” : 11112,  
“DefaultEncoding” : “Latin1”,  
“DeflatedTransferSyntaxAccepted” : true,  
“JpegTransferSyntaxAccepted” : true,  
“Jpeg2000TransferSyntaxAccepted” : true,  
“JpegLosslessTransferSyntaxAccepted” : true,  
“JpipTransferSyntaxAccepted” : true,  
“Mpeg2TransferSyntaxAccepted” : true,  
“RleTransferSyntaxAccepted” : true,  
“RemoteAccessAllowed” : true,  
“SslEnabled” : false,  
“SslCertificate” : “certificate.pem”,  
“AuthenticationEnabled” : true,  
“RegisteredUsers” : {  
“admin” : “admin”  
},

“DicomModalities” : {  
“local” : [“ORTHANC”, “localhost”, 11112]  
},

“OrthancPeers” : {  
},  
“UserMetadata” : {  
},  
“StableAge” : 60,  
“HttpServerEnabled” : true,  
“DicomServerEnabled” : true,  
“StrictAetComparison” : false,  
“StoreMD5ForAttachments” : true,  
“LimitFindResults” : 0,  
“LimitFindInstances” : 0,  
“LimitJobs” : 10,  
“LogExportedResources” : true,  
“KeepAlive” : false,  
“StoreDicom” : true,  
“DicomAssociationCloseDelay” : 5,  
“QueryRetrieveSize” : 10,  
“CaseSensitivePN” : false  
}

**DO query**

curl [http://localhost:8000/modalities/local/find-patient](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A8000%2Fmodalities%2Flocal%2Ffind-patient&sa=D&sntz=1&usg=AFQjCNHF5QFQBSYHC7cidkp-jgz3W9SlaQ) -X POST -d ‘{“PatientName”:“\*”,“PatientSex”:“M”}’

**I receive an error how to solve this problem?**

cat /var/log/orthanc/Orthanc.ERROR  
Log file created at: 2015/09/21 01:00:14  
Running on machine: pacs  
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg  
E0921 01:00:14.493993 24826 CommandDispatcher.cpp:456] Receiving Association failed: Unrecognized PDU type: 50

---

<div class="post-metadata">

### Author: ![jodogne](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/jodogne/32/1511_2.png) [@jodogne](https://discourse.orthanc-server.org/u/jodogne)
#### Post date: [September 21, 2015, 7:15am UTC](https://discourse.orthanc-server.org/t/rest-api-receiving-association-failed/275/2 "2015-09-21T07:15:30Z")

</div>

You have enabled HTTP authentication, so you need to give the credentials to curl. The following command will work:

# curl [http://admin:admin@localhost:8000/modalities/local/find-patient](http://admin:admin@localhost:8000/modalities/local/find-patient) -X POST -d ‘{“PatientName”:“\*”,“PatientSex”:“M”}’ -v

Please also note that, according to the format of the log, you do not use the latest version of Orthanc.

Sébastien-

---

<div class="post-metadata">

### Author: ![Ilya](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/i/58f4c7/32.png) [@Ilya](https://discourse.orthanc-server.org/u/Ilya)
#### Post date: [September 21, 2015, 7:31am UTC](https://discourse.orthanc-server.org/t/rest-api-receiving-association-failed/275/3 "2015-09-21T07:31:28Z")

</div>

Thank you for your response. You really helped.  
Thank you for your work on this project.
