(Quick Reference)

Species

list

  • Path : /api/species
  • Parameters :
    • startsWith : any capital letter in A-Z. Defaults to all
    • sGroup : speciesGroupId. default all
    • habitat : habitat id. default all
    • daterangepicker_start : last_updated start date
    • daterangepicker_end : last_updated end date
    • featureBy : true|false. default false
    • webaddress : to filter observations with group with this webaddress
    • max: limit of number of results. default 42 max 100
    • offset : offset in to the result set. default 0
    • sort: lastRevised|lastUpdated|percentOfInfo|score. default lastRevised desc, id asc
  • REST method : GET
  • Requests :
    • _With species group and habitat filter_

http://indiabiodiversity.org/api/species?sGroup=837&habitat=267835
  • Response :

{
    "success": true,
        "status": 200,
        "msg": "",
        "model": {
            "speciesInstanceList": [ … ],
            "instanceTotal": 1769,
            "speciesCountWithContent": 210,
            "userGroupWebaddress": null,
            "queryParams": {
                "max": 42,
                "offset": 0,
                "sort": "lastUpdated",
                "order": "desc",
                "sGroup": [
                    837
                    ]
            }
        }
}

show

  • Path : /api/species/id
  • Parameters : id
  • REST method : GET
  • Request :

http://indiabiodiversity.saturn.strandls.com/api/species/1
  • Response :
    • Successful response

{
    "success": true,
        "status": 200,
        "msg": "",
        "instance": {
            "id": 253727,
            "title": "<i>Balanophora globosa </i>Jungh. ",
            "taxonConcept": {
                "id": 149196,
                "name": "Balanophora globosa Jungh.",
                "canonicalForm": "Balanophora globosa",
                "italicisedForm": "<i>Balanophora globosa </i>Jungh. ",
                "rank": "Species"
            },
            "taxonRegistry": [
            {
                "clasification": {
                    "id": 818,
                    "name": "GBIF Taxonomy Hierarchy",
                    "citation": "<a target='_blank' href='http://data.gbif.org/datasets/resource/1'>Accessed through GBIF data portal, GBIF Backbone Taxonomy</a>"
                },
                "hierarchies": [
                {
                    "id": 2998,
                    "name": "Plantae",
                    "canonicalForm": "Plantae",
                    "italicisedForm": "<i>Plantae</i>",
                    "rank": "Kingdom"
                },
                {
                    "id": 3000,
                    "name": "Magnoliophyta",
                    "canonicalForm": "Magnoliophyta",
                    "italicisedForm": "<i>Magnoliophyta</i>",
                    "rank": "Phylum"
                },
                {
                    "id": 33366,
                    "name": "Magnoliopsida",
                    "canonicalForm": "Magnoliopsida",
                    "italicisedForm": "<i>Magnoliopsida</i>",
                    "rank": "Class"
                },
                {
                    "id": 6136,
                    "name": "Santalales",
                    "canonicalForm": "Santalales",
                    "italicisedForm": "<i>Santalales</i>",
                    "rank": "Order"
                },
                {
                    "id": 35555,
                    "name": "Balanophoraceae",
                    "canonicalForm": "Balanophoraceae",
                    "italicisedForm": "<i>Balanophoraceae</i>",
                    "rank": "Family"
                },
                {
                    "id": 149184,
                    "name": "Balanophora",
                    "canonicalForm": "Balanophora",
                    "italicisedForm": "<i>Balanophora</i>",
                    "rank": "Genus"
                },
                {
                    "id": 149196,
                    "name": "Balanophora globosa Jungh.",
                    "canonicalForm": "Balanophora globosa",
                    "italicisedForm": "<i>Balanophora globosa </i>Jungh. ",
                    "rank": "Species"
                }
                ]
            }
            ],
                "synonyms": [],
                "common_names": [],
                "group": {
                    "id": 833,
                    "name": "Plants",
                    "groupOrder": 9
                },
                "habitat": null,
                "createdOn": "3912-02-22T18:30:00Z",
                "lastRevised": "2014-11-26T12:27:30Z",
                "thumbnail": "http://indiabiodiversity.localhost.org/biodiv/group_icons/speciesGroups/plants_th1.png",
                "notes": "",
                "summary": "",
                "fields": [],
                "resource": [],
                "userGroups": [],
                "featureCount": 0,
                "featuredNotes": []
        }
}
    • in case of error

{
    "success": false,
    "status" : 200,
    "msg": "Valid id is required"
}
{
    "success": false,
        "status": 200,
        "msg": "Coudn't find species with id 1",
        "errors": []
}

Related Species

  • Path : /api/related/species/$filterProperty/$filterPropertyValue
  • Parameters :
    • filterProperty : featureBy
    • filterPropertyValue : true
    • limit : max number of records. default 12
    • offset : offset into the result set. default 0
  • Featured Species__

http://indiabiodiversity.org/api/related/species/featureBy/true?limit=10&offset=0

delete

  • Path : /api/species/id/delete
  • Parameters :
    • id : species id
    • REST Method : DELETE or POST
    • Permission : Need admin permission to delete
  • Request :

http://indiabiodiversity.localhost.org/api/species/234/delete
  • Response :
    • on success

{
    "success": true,
    "msg": "Species 234 deleted",
    "errors": []
}
    • in case of error

{
    "success": false,
    "msg": "Species 234sdf could not be deleted",
    "errors": [
    {
        "message": "For input string: "234sdf""
    }
    ]
}

{ "success": false, "msg": "Species not found with id null", "errors": [] }

update

  • Path : /api/species/id/update
  • Parameters :
    • name : contributor | attribution | description | newdescription | license | audienceType | status | reference | synonym | commonname | speciesField
    • pk : species field id
    • value : species field value
    • act : delete | update
    • cid : needed in case of deleting or updating contributor, attribution, commonname
    • sid : needed in case of deleting or updating a synonym
    • relationship : needed for synonym.
    • language : needed for common name. Language name as in db.
    • speciesid : species id needed in case of new description
    • description : needed for updating species field
    • REST Method : PUT | POST
    • Permission : user should have permission at any level in the species hierarchy to use this operation. Else please request for permission using requestPermission.
    • Requests
  • Adding synonym

url : http://indiabiodiversity.localhost.org/api/species/275594/update
name:synonym
value:Test indica
pk:275594
relationship:Synonym
  • Editing synonym

url : http://indiabiodiversity.localhost.org/api/species/update
name:synonym
value:Test indicatwo
pk:275594
relationship:Synonym
sid:221654
  • Deleting synonym

url : http://indiabiodiversity.localhost.org/api/species/update
name:synonym
pk:275594
act:delete
sid:221655
  • Adding speciesfield

url : http://indiabiodiversity.localhost.org/api/species/update
description:<p>desc</p>
attribution:a1
contributor:1
audienceType:General Audience
license:CC BY
reference:r1
pk:501520
speciesid:275594
act:add
name:speciesField
runForImages:false
  • Editing speciesfield

url : http://indiabiodiversity.localhost.org/api/species/update
description:<p>desc2</p>
attribution:a1
contributor:1
audienceType:General Audience
license:CC BY
reference:r1
pk:501520
speciesid:275594
act:edit
name:speciesField
runForImages:false
  • Deleting speciesfield

url : http://indiabiodiversity.localhost.org/api/species/update
pk:501520
speciesid:275594
act:delete
name:speciesField

setResources

  • Path : /api/species/setResources
  • Parameters :
    • id : species id
    • resourceListType: ofSpecies | fromSingleSpeciesField | ofObv | null | usersResource
    • type : IMAGE | VIDEO | AUDIO
    • title : title of the resource
    • license : license for the resource
    • url : url for the resource
    • source : source from where this resource was picked
    • rating : rating for the resource
    • contributor : uploader of the resource
    • REST Method : POST
    • Permission : any logged in user having permission on this species
    • Notes : use index format as in _ for all keys such as title, license, url etc., to give multiple resources in same call. Existing resources of the species will be deleted and all mentioned in this call are set for the species.
  • Request :

url : http://indiabiodiversity.localhost.org/api/species/setResources
speciesId:275594
file_1:/8378307e-55ad-4e95-8600-7c8beb5e09ba/861.JPG
url_1:
type_1:IMAGE
date_1:false
rating_1:
license_1:CC BY
contributor_1:
source_1:http://indiabiodiversity.localhost.org/observation/show/349285
title_1:
pullImage_1:true
resId_1:343640
file_0:/a6ec1310-ea71-49d7-8409-884fd0ec2484/641.JPG
url_0:
type_0:IMAGE
date_0:false
rating:
license_0:CC BY
contributor_0:
source_0:http://indiabiodiversity.localhost.org/observation/show/349188
title_0:
pullImage_0:true
resId_0:343540
relatedImagesOffset:2
resourceListType:fromRelatedObv

url : http://indiabiodiversity.localhost.org/api/species/setResources
speciesId:275594
file_2:v
url_2:http://www.youtube.com/watch?v=v8HVWDrGr6o
type_2:VIDEO
date_2:false
rating_2:4
license_2:CC BY
contributor_2:admin
source_2:http://www.youtube.com/watch?v=v8HVWDrGr6o
title_2:
resId_2:277437
resourceListType:ofSpecies

count

  • Path : /api/species/count

requestExport

  • Path : /api/species/requestExport
  • Parameters :
    • filterUrl : filterUrl as in list call
    • downloadType
    • notes
    • source
    • REST Method : GET | POST
    • Permission : admin
    • Notes : the download will be scheduled and a link to download will be send to the requester email.
  • Request :

upload

  • Path : /api/species/upload
  • Parameters :
    • xlsxFileUrl : xls file in mentioned format is required
    • imagesDir : path to images dir relative to appln data dir where images are present.
    • REST Method : POST
    • Permission : species admin
    • Notes :
  • Request :

requestPermission

  • Path : /api/species/requestPermission
  • Parameters :
    • selectedNodes : csv of taxonConcept ids
    • inviteType : contributor | curator . Default:contributor
    • message : text that can be sent as message in the email to the admins
    • REST Method : GET
    • Permission : logged in user
    • Notes :
  • Request :

http://indiabiodiversity.localhost.org/api/species/requestPermission
invitetype:contributor
message:test
selectedNodes:94899

invite

  • Path : /api/species/invite
  • Parameters :
    • userIds : csv of user ids
    • inviteType : curator | contributor. Default contributor
    • REST Method : GET
    • Permission : species admin or admin
    • Notes :
  • Request :

http://indiabiodiversity.localhost.org/api/species/invite

searchPermission

  • Path : /api/species/searchPermission
  • Parameters :
    • rank : sci name rank number
    • page : scientific name
    • user : returns permissions for the user
    • REST Method : GET | POST
    • Permission : species admin or admin
    • Notes :
  • Request :

getRelatedObvForSpecies

  • Path : /api/species/getRelatedObvForSpecies
  • Parameters :
    • speciesId : species id
    • offset : 0
    • REST Method :
    • Permission : logged in user
    • Notes :
  • Request :

http://indiabiodiversity.localhost.org/api/species/getRelatedObvForSpecies?speciesId=275594