Search.byhash: Difference between revisions

From Safe Creative API
Jump to navigation Jump to search
w>Jguillo
(Created page with 'Search for works by specifying the SHA-1 or MD5 hash of the work contents. This component must be called on the main API server <code><nowiki>http://api.safecreative.org</nowiki…')
 
m (3 revisions imported)
 
(2 intermediate revisions by one other user not shown)
Line 2: Line 2:


This component must be called on the main API server <code><nowiki>http://api.safecreative.org</nowiki></code>
This component must be called on the main API server <code><nowiki>http://api.safecreative.org</nowiki></code>
Binary hashes must be encoded as a string of hexadecimal lowercase digits (0123456789abcdef), using two digits per byte.


Results are [[Paginated responses|paginated]]
Results are [[Paginated responses|paginated]]
Line 47: Line 49:
** '''machine-url''': URL to this work API info response (see [[work.get]])
** '''machine-url''': URL to this work API info response (see [[work.get]])


= Sample =
= Example =
REQUEST (searching for photographs under a Creative Common license which can be downladed):
REQUEST (searching for photographs under a Creative Common license which can be downladed):



Latest revision as of 08:07, 7 May 2021

Search for works by specifying the SHA-1 or MD5 hash of the work contents.

This component must be called on the main API server http://api.safecreative.org

Binary hashes must be encoded as a string of hexadecimal lowercase digits (0123456789abcdef), using two digits per byte.

Results are paginated

Info

  • Component name: search.byhash
  • Signature: No signature required
  • Timestamp: Ztime is not required
  • API trust level: Public
  • API server: http://api.safecreative.org

Parameters

  • md5: MD5 hash of the searched work contents
  • sha1: SHA-1 hash of the searched work contents
  • user: User code. If specified only works owned by this user will be searched
  • page: Page number
  • locale: Locale for work type, license names,...

* Required parameter

Returns

Paginated list of work elements

  • work
    • code: Safe Creative work code
    • title: Work title
    • authors: List of authors
      • author
        • code: Author's Safe Creative user code
        • name: Author's full name
        • human-url: URL to the author's Safe Creative public profile
    • rights-holders: List of rights holders
      • rights-holder
        • code: Rights holder's Safe Creative user code
        • name: Rights holder's full name
        • human-url: URL to the rights holder's Safe Creative public profile
    • thumbnail: URL to the work thumbnail (if any)
    • license: Work license
      • code: License code
      • name: License name
      • shortname: License short name
      • human-url: URL to license text
      • features: License features (see user.licenses
    • human-url: URL to this work web page in Safe Creative
    • machine-url: URL to this work API info response (see work.get)

Example

REQUEST (searching for photographs under a Creative Common license which can be downladed):

https://api.safecreative.org/v2/
?component=search.byhash
&md5=a4bba01211c830db0e3ee6d95686848b

RESPONSE:

<?xml version="1.0" encoding="UTF-8"?>
<listpage>
  <recordtotal>1</recordtotal>
  <pagetotal>1</pagetotal>
  <list>
    <work>
      <code>1004296139061</code>
      <state>REGISTERED</state>
      <title>The ant bee and flower</title>
      <authors>
        <author>
          <code>0709270000528</code>
          <name>Mario Pena Zapatería</name>
          <human-url>http://www.safecreative.org/user/0709270000528</human-url>
        </author>
      </authors>
      <rights-holders>
        <rights-holder>
          <code>0709270000528</code>
          <name>Mario Pena Zapatería</name>
          <human-url>http://www.safecreative.org/user/0709270000528</human-url>
        </rights-holder>
      </rights-holders>
      <thumbnail>https://thumbnails-safecreative-org.s3.amazonaws.com/1/</thumbnail>
      <license>
        <code>http://creativecommons.org/licenses/by-sa/3.0/</code>
        <name>Creative Commons Attribution Share Alike 3.0</name>
        <shortname>CC by-sa</shortname>
        <human-url>http://www.safecreative.org/license/http%3A%2F%2Fcreativecommons.org%2Flicenses%2Fby-sa%2F3.0%2F</human-url>
        <features>
          <timelimited>NOT_APPLICABLE</timelimited>
          <recognition>YES</recognition>
          <commercial>YES</commercial>
          <distribution>YES</distribution>
          <derivations>INHERITANCE</derivations>
        </features>
      </license>
      <human-url>http://www.safecreative.org/work/1004296139061</human-url>
      <machine-url>http://www.safecreative.org/v2/?component=work.get&code=1004296139061</machine-url>
    </work>
  </list>
</listpage>