Attachment Date

Tagged:

Currently contains 13 posts

Avatar

October 12, 2020 22:43

hirenexus

I’m trying to get the attachment date in a company record to match the date passed in the data for the attachment but it’s always using the current date/time stamp. Is there a special format or something that should be used?

I’m using PHP and this is the array for the data:

$attachment_data = array(
‘Name’ => $name,
‘_Type’ => $type,
‘Description’ => $description,
‘Date’ => $date,
‘Data’ => $source_html,

);

$date is set to a dynamic date with a format of m/d/yyyy. I tried with and without time and neither of them worked.

Avatar

October 12, 2020 23:01

Jarrid-PCRecruiter

I don’t believe the system will allow you to alter dates of existing attachments since we’d have no way of tracking issues with them. Imagine if you had an attachment dated before the actual company record was added… We’re using the actual time the attachment was added in order to track the data. The correct format is:
Date Field Format
Dates should be sent (and will be returned) in ISO-8601 format for all non-custom fields.

Custom fields will be returned in the format based on the accept-language submitted in the header. If no accept-language is submitted then the default en-US en-US will be applied which is MM-DD-YYYY.

Avatar

October 13, 2020 02:10

hirenexus

Yeah this isn’t an existing attachment. It’s a news article about the company but it is possible the press date is before we had the company in PCR. I’m sending the date information over in en-US format but I will try ISO format instead. See if that lets me set the date to the date of the article.

Avatar

October 13, 2020 02:17

hirenexus

Just tried that and it still used the current date/time. What is the purpose of the date field in the JSON we send to PCR then?

Avatar

October 13, 2020 14:58

Jarrid-PCRecruiter

I think we need to change the documentation on our side. Again, this is the time/date the attachment was added so we don’t accept “date” in the payload.

Avatar

October 14, 2020 20:38

hirenexus

Okay great. And just so you know, you can’t test the attachments API either. It doesn’t pass the RecordType parameter.

Avatar

October 14, 2020 20:39

Jarrid-PCRecruiter

I’m not sure what you mean, can you please give me an example?

Avatar

October 14, 2020 21:23

hirenexus

https://www.pcrecruiter.net/rest/api/{RecordType}/attachments?SessionID=fG1yZWxnaW4uG1UL5Fhz%2B8CF8dP8Ri6uq8QGhqapIMuFWwjTDJArVq5DF422nGAG1XiVP6PsiYXiekuddlfQJDpEmyDrXQ%3D%3D

{
“errors”: “Invalid Route”
}

Avatar

October 14, 2020 21:24

hirenexus

If you try to test the attachments API that’s what happens with the URL and the second thing is the response.

Avatar

October 14, 2020 21:24

hirenexus

Also, did you guys change something with the attachments API? I had it working yesterday and now it’s saying “Data is required”. I’m sending the data as base64. Should it be something different?

Avatar

October 14, 2020 21:29

Jarrid-PCRecruiter

{RecordType} is indicating a variable as described in the documentation:
Record Type: [candidates, companies, positions, presentations, profiles, global]
So you’d want something like:
https://www.pcrecruiter.net/rest/api/candidates/attachments?SessionID=fG1yZWxna

Base64 is the correct encoding.

Avatar

October 14, 2020 21:34

hirenexus

Right, but I’m trying to test the attachments API and even if I enter companies in the API docs: https://www.pcrecruiter.net/apidocs_v2/#!/attachments/PostCreateAttachments_post_5

It gives me that error.

Avatar

October 14, 2020 21:43

Jarrid-PCRecruiter

I see what you mean, that’s only going to be the correct end point for global attachments, you’d need to specify the company you’d like to attach the document to otherwise.

Add the companyId to the call:
https://www.pcrecruiter.net/rest/api/companies/987806049960934/attachments?SessionId=${"REST API Testing"

Reply to thread