We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

OSC-CREST-00013 - Unrecognised resource

Accepted answer
22
Views
2
Comments
edited Jul 17, 2019 11:34AM in Integrations and APIs 2 comments

Content

Hi,

Please see code below - so I'm trying to upload Base64 data as an attachment to an incident.

However I get this error:

{
    "type": "https://mydomain.custhelp.com/services/rest/connect/exceptions/OSC-CREST-00013",
    "title": "Unrecognised resource",
    "status": 404,
    "detail": "Resource with id 705951 not found",
    "instance": "https://mydomain.custhelp.com/services/rest/connect/v1.3/incidents/705951/fileAttachments",
    "o:errorCode": "OSC-CREST-00013"
}

This incident exists though - I can confirm this by going to the link the error says does not exist. This code sits in the model.

Am I doing anything obviously wrong?

Code Snippet

$contact = json_encode($this->CI->session->getProfile(), true);
$contact = json_decode($contact, true);
$uid = $contact['c_id']['value'];

$incident = new RNCPHP\Incident();
$incident->Subject = $subject;
$incident->Product =  RNCPHP\ServiceProduct::fetch(616);
$incident->Category = RNCPHP\ServiceCategory::fetch(624);
$incident->AssignedTo = new RNCPHP\GroupAccount();
$incident->AssignedTo->StaffGroup->ID = 106987;
$incident->CustomFields->c->details_of_enquiry = $value;
$incident->Channel = new RNCPHP\NamedIDLabel();
$incident->Channel->LookupName = "Service Email";
$incident->SiteInterface =  new RNCPHP\NamedIDLabel();
$incident->SiteInterface->ID = 1;
$incident->PrimaryContact = RNCPHP\Contact::fetch($uid);
$incident->Queue = new RNCPHP\NamedIDLabel();
$incident->Queue->LookupName = "Project Manager";		 
$incident->StatusWithType               = new RNCPHP\StatusWithType() ;
$incident->StatusWithType->Status       = new RNCPHP\NamedIDOptList() ;
$incident->StatusWithType->Status->ID   = 1 ;
$incident->Threads = new RNCPHP\ThreadArray();
$incident->Threads[0] = new RNCPHP\Thread();
$incident->Threads[0]->EntryType = new RNCPHP\NamedIDOptList();
$incident->Threads[0]->EntryType->ID = 3;
$incident->Threads[0]->ContentType = 2;
$incident->Threads[0]->Text = $value;	
$incident->save(RNCPHP\RNObject::SuppressAll);
$i_id =  $incident->ID;
			
$co = 
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!