• ccPeter
  • NEWBIE
  • 75 Points
  • Member since 2011

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 11
    Replies

Once a document has been uploaded to the "managing" Content Library the user has the option to share the document with another Content Library.

 

Does anybody know whether this can be done with the REST or SOAP API and how? 

 

Thanks

Peter

When I try to create a GoogleDoc record using the SOAP Partner API I get an INVALID_TYPE error and a message indicating that this object is not supported. However, GoogleDoc is a fully documented object in the documentation. I attached a Fiddler trace below. Could you please point out what I am doing wrong?

 

Thanks

Peter

 

POST https://na9-api.salesforce.com/services/Soap/u/24.0/00DE0000000KIZ5 HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.5456)
VsDebuggerCausalityData: uIDPoz4wmquBUIFKsi3W8RPGXNEAAAAAFu
+zmHtbC0aaj84t3XXBKLQ/Jc0JNB5Nmt/8vnEUz6oACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: na9-api.salesforce.com
Content-Length: 843
Connection: Keep-Alive

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><SessionHeader
xmlns="urn:partner.soap.sforce.com"><sessionId>00DE0000000KIZ5!
ARcAQLlaOd_qgwFtjFTH0AGlC3SSj_tgQ5hFOhGub3zPJ9QZ9sr63aVHKJ2wsuKvGbbTIw_L0Jtc_XFq0l.UH2f
Ca5XnBPzR</sessionId></SessionHeader></soap:Header><soap:Body><create
xmlns="urn:partner.soap.sforce.com"><sObjects><type
xmlns="urn:sobject.partner.soap.sforce.com">GoogleDoc</type><Id xsi:nil="true"
xmlns="urn:sobject.partner.soap.sforce.com" /><Name xmlns="">Test4.pdf</Name><ParentId
xmlns="">001E000000BYKYyIAP</ParentId><Url
xmlns="">https://docs.google.com/file/d/0B4CnLVqJh8u5alh1ajgwVjRNRUU/edit</Url></sObjects></create></s
oap:Body></soap:Envelope>

 

 

HTTP/1.1 200 OK
Server:
Content-Type: text/xml; charset=utf-8
Content-Length: 653
Date: Sat, 26 May 2012 17:09:41 GMT

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"><soapenv:Body><createResponse><result><errors><message>sObject type
&apos;GoogleDoc&apos; is not supported. If you are attempting to use a custom object, be sure to append the
&apos;__c&apos; after the entity name. Please reference your WSDL or the describe call for the appropriate
names.</message><statusCode>INVALID_TYPE</statusCode></errors><id
xsi:nil="true"/><success>false</success></result></createResponse></soapenv:Body></soapenv:Envelope>

When adding content (with the 'Contribute Content' dialog that "pops up" after clicking the 'Contribute' button) you can upload a file or you can enter a URL. After entering the information, in the next dialog you can select the destination library and associated content type (which determines the list of custom fields to enter).

 

I would like to contribute content other than a file or URL. Is there a way to override/replace the 'Contribute Content' dialog but keep the next page where the destination library and content type are selected?

 

After studying it seems to me this override capability does not exist and I would need to duplicate the page (and associated logic) where the destination library is selected and the content is inserted. It would be great of course if I could avoid that.

 

Thank you in advance for some helpful suggestions.

Peter

When the user has Google Docs enabled, is there anyway for an application to retrieve the Google Docs access token stored at Salesforce with a REST or SOAP API? I would like to give our users the capability to upload a document to Google Docs and store the URL in a Salesforce attachment without the user having to login to Google Docs (to make this appear as seamless as possible).

 

Thanks

Peter

Is there any way that a document uploaded to a Content Library (using the REST API) can be associated with the Related Content list of an Account, Contact, or Opportunity record using a REST or SOAP API?

 

Thanks

Peter

  • September 23, 2011
  • Like
  • 0

Hi Simon, I was hoping you could help me out with another question: what API in REST (or SOAP in case REST does not support it) do I use to find out what Content Types are associated with a Library?


- ContentWorkspace contains DefaultRecordTypeID, however, it does not point to other Content Types associated with the same ContentWorkSpace
- For RecordType you can list all records of type “ContentVersion” but these records do not point back to a ContentWorkspace
- With DescribeLayout(“ContentVersion”, null) all ContentTypes are listed but they do not contain any references back to a ContentWorkspace (unless I missed it somehow)


I suspect there is another intermediate record or API that returns the association between Libraries and Content Types; please point me in the right direction.


Thanks
Peter

When doing a "Describe" on ContentVersion, all custom input fields (xxx__c) defined for all Content Types are included in the result. When putting up an input form, in the case where a Library only has a particular Content Type attached, how do restrict the custom input fields to only the ones defined in the Content Type(s) attached to the Library?

 

Another way of asking the same question is, how do you use the REST API to enumerate the custom fields defined for a particular Content Type?

 

Thanks
Peter

Once you learn the id of a library's Content Type (for example, the DefaultRecordTypeId in ContentWorkspace), how do you look up the actual Content Type information? I would have expected an entity named ContentType that can be queried but that does not seem to exist.

 

Thank you in advance for an answer.

 

Peter

Content libraries can be enumerated with ContentWorkspaces. That will give me the name, description, etc of the available libraries. In addition, I get the DefaultRecordTypeId that identifies the Content Type assigned to the library. The Content Type contains the characteristics of the various custom input fields that the admin has created. I would like to enumerate these custom input fields. I was looking for something named Field or ContentField maybe that I could query given the DefaultRecordTypeId. Therefore please answer the following questions when you get a chance:

 

- How do I enumerate the input fields contained in a Content Type?

 

- How do I know that multiple Content Types have been attached to a library?

 

Thanks

Peter

In my application I use the REST API to enumerate the folders available in Documents. I use the following query:

"query?q=SELECT+Name,AccessType,IsReadonly+from+Folder"

 

This works fine, except that the only folder records returned are the ones for folders I explicitly created. To my surprise the default "My Personal Documents" folder is not included.

 

Since I would like to give our users the capability to add documents to this default folder too, how can I possibly change my query so that "My Personal Documents" is included in the returned list of folders?

 

Thanks

Peter

When I try to create a GoogleDoc record using the SOAP Partner API I get an INVALID_TYPE error and a message indicating that this object is not supported. However, GoogleDoc is a fully documented object in the documentation. I attached a Fiddler trace below. Could you please point out what I am doing wrong?

 

Thanks

Peter

 

POST https://na9-api.salesforce.com/services/Soap/u/24.0/00DE0000000KIZ5 HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.5456)
VsDebuggerCausalityData: uIDPoz4wmquBUIFKsi3W8RPGXNEAAAAAFu
+zmHtbC0aaj84t3XXBKLQ/Jc0JNB5Nmt/8vnEUz6oACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: na9-api.salesforce.com
Content-Length: 843
Connection: Keep-Alive

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><SessionHeader
xmlns="urn:partner.soap.sforce.com"><sessionId>00DE0000000KIZ5!
ARcAQLlaOd_qgwFtjFTH0AGlC3SSj_tgQ5hFOhGub3zPJ9QZ9sr63aVHKJ2wsuKvGbbTIw_L0Jtc_XFq0l.UH2f
Ca5XnBPzR</sessionId></SessionHeader></soap:Header><soap:Body><create
xmlns="urn:partner.soap.sforce.com"><sObjects><type
xmlns="urn:sobject.partner.soap.sforce.com">GoogleDoc</type><Id xsi:nil="true"
xmlns="urn:sobject.partner.soap.sforce.com" /><Name xmlns="">Test4.pdf</Name><ParentId
xmlns="">001E000000BYKYyIAP</ParentId><Url
xmlns="">https://docs.google.com/file/d/0B4CnLVqJh8u5alh1ajgwVjRNRUU/edit</Url></sObjects></create></s
oap:Body></soap:Envelope>

 

 

HTTP/1.1 200 OK
Server:
Content-Type: text/xml; charset=utf-8
Content-Length: 653
Date: Sat, 26 May 2012 17:09:41 GMT

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"><soapenv:Body><createResponse><result><errors><message>sObject type
&apos;GoogleDoc&apos; is not supported. If you are attempting to use a custom object, be sure to append the
&apos;__c&apos; after the entity name. Please reference your WSDL or the describe call for the appropriate
names.</message><statusCode>INVALID_TYPE</statusCode></errors><id
xsi:nil="true"/><success>false</success></result></createResponse></soapenv:Body></soapenv:Envelope>

Is there any way that a document uploaded to a Content Library (using the REST API) can be associated with the Related Content list of an Account, Contact, or Opportunity record using a REST or SOAP API?

 

Thanks

Peter

  • September 23, 2011
  • Like
  • 0

Hi Simon, I was hoping you could help me out with another question: what API in REST (or SOAP in case REST does not support it) do I use to find out what Content Types are associated with a Library?


- ContentWorkspace contains DefaultRecordTypeID, however, it does not point to other Content Types associated with the same ContentWorkSpace
- For RecordType you can list all records of type “ContentVersion” but these records do not point back to a ContentWorkspace
- With DescribeLayout(“ContentVersion”, null) all ContentTypes are listed but they do not contain any references back to a ContentWorkspace (unless I missed it somehow)


I suspect there is another intermediate record or API that returns the association between Libraries and Content Types; please point me in the right direction.


Thanks
Peter

When doing a "Describe" on ContentVersion, all custom input fields (xxx__c) defined for all Content Types are included in the result. When putting up an input form, in the case where a Library only has a particular Content Type attached, how do restrict the custom input fields to only the ones defined in the Content Type(s) attached to the Library?

 

Another way of asking the same question is, how do you use the REST API to enumerate the custom fields defined for a particular Content Type?

 

Thanks
Peter

Once you learn the id of a library's Content Type (for example, the DefaultRecordTypeId in ContentWorkspace), how do you look up the actual Content Type information? I would have expected an entity named ContentType that can be queried but that does not seem to exist.

 

Thank you in advance for an answer.

 

Peter

Content libraries can be enumerated with ContentWorkspaces. That will give me the name, description, etc of the available libraries. In addition, I get the DefaultRecordTypeId that identifies the Content Type assigned to the library. The Content Type contains the characteristics of the various custom input fields that the admin has created. I would like to enumerate these custom input fields. I was looking for something named Field or ContentField maybe that I could query given the DefaultRecordTypeId. Therefore please answer the following questions when you get a chance:

 

- How do I enumerate the input fields contained in a Content Type?

 

- How do I know that multiple Content Types have been attached to a library?

 

Thanks

Peter

In my application I use the REST API to enumerate the folders available in Documents. I use the following query:

"query?q=SELECT+Name,AccessType,IsReadonly+from+Folder"

 

This works fine, except that the only folder records returned are the ones for folders I explicitly created. To my surprise the default "My Personal Documents" folder is not included.

 

Since I would like to give our users the capability to add documents to this default folder too, how can I possibly change my query so that "My Personal Documents" is included in the returned list of folders?

 

Thanks

Peter