### Get Project Article Details (PHP) Source: https://docs.figshare.com/index__gl=1%2Aehu6sc%2A_ga%2AMTAzMDIzODgwMy4xNzY5NTgzNTgz%2A_ga_CHDNWH4YDX%2AczE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw PHP example demonstrating how to initialize the Figshare API client and set the OAuth2 access token for authentication. This snippet shows the setup before making the actual API call to retrieve project article details. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new Swagger\Client\Api\ProjectsApi(); $projectId = 789; // Long | Project unique identifier $articleId = 789; // Long | Project Article unique identifier // Note: The actual API call and response handling would follow this setup. ``` -------------------------------- ### GET Articles Example Source: https://docs.figshare.com/ Example of how to send parameters in the query string for a GET request to list articles. ```APIDOC ## Sending parameters in Query String **Example**: Sending `page` parameter when listing articles: ``` GET /v2/articles?page=3 HTTP/1.1 Host: api.figshare.com Authorization: token a287ab8c7ebdbe6 ``` ``` -------------------------------- ### Get Project Articles using PHP Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This PHP code example demonstrates how to list articles within a project using the Figshare API. It shows the necessary setup for authentication and making the API call, including basic error handling. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new Swagger\Client\Api\ProjectsApi(); $projectId = 789; // Long | Project unique identifier try { $result = $api_instance->privateProjectArticlesList($projectId); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProjectsApi->privateProjectArticlesList: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### GET Impersonation Example Source: https://docs.figshare.com/?_gl=1*ehu6sc*_ga*MTAzMDIzODgwMy4xNzY5NTgzNTgz*_ga_CHDNWH4YDX*czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw#!/oauth/get_token_info This example demonstrates how to retrieve articles belonging to an impersonated account using a GET request. ```APIDOC ## GET /v2/account/articles?impersonate={user_id} ### Description Retrieves articles associated with a specified user ID as if the request were made by that user. ### Method GET ### Endpoint /v2/account/articles ### Query Parameters - **impersonate** (integer) - Required - The ID of the user account to impersonate. ``` -------------------------------- ### Impersonation - GET Example Source: https://docs.figshare.com/?_gl=1*ehu6sc*_ga*MTAzMDIzODgwMy4xNzY5NTgzNTgz*_ga_CHDNWH4YDX*czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw#!/oauth/get_token_info Demonstrates how to use the 'impersonate' query parameter for GET requests to access resources as another account. ```APIDOC ## GET Impersonation Example ### Description This example shows how to impersonate another account when making a GET request. The `impersonate` parameter is included in the query string. ### Method GET ### Endpoint /v2/account/articles?impersonate={account_id} ### Parameters #### Query Parameters - **impersonate** (int) - Required - The account ID of the user to impersonate. ### Request Example ```http GET /v2/account/articles?impersonate=1000009 HTTP/1.1 ``` ### Response Success Response (200) - The response will contain articles of the impersonated account. ``` -------------------------------- ### Get Project Article Details (JavaScript) Source: https://docs.figshare.com/index JavaScript example using the Figshare API client to get project article details. Demonstrates setting the OAuth2 access token and calling the relevant API method. ```javascript var FigshareApi = require('figshare_api'); var defaultClient = FigshareApi.ApiClient.instance; // Configure OAuth2 access token for authorization: OAuth2 var OAuth2 = defaultClient.authentications['OAuth2']; OAuth2.accessToken = "YOUR ACCESS TOKEN" var api = new FigshareApi.ProjectsApi() var projectId = 789; // {Long} Project unique identifier var articleId = 789; // {Long} Project Article unique identifier var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.privateProjectArticleDetails(projectId, articleId, callback); ``` -------------------------------- ### Daily Downloads Timeline for an Article (GET Request) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info Example of an HTTP GET request to retrieve the daily download counts for a specific article. This demonstrates the general endpoint format with 'day' granularity and 'downloads' counter. ```HTTP GET https://stats.figshare.com/timeline/day/downloads/article/766364 ``` -------------------------------- ### Upload Initialization Request Example Source: https://docs.figshare.com/index This conceptual snippet shows how to initiate a file upload. It requires the file name and size, and the response provides an upload URL and token. ```text POST /files/upload Content-Type: application/json { "name": "my-file.zip", "size": 10249281 } ``` -------------------------------- ### Figshare API GET Request Example Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This example demonstrates how to request a daily breakdown of views for a specific article using the figshare statistics API. It includes the start and end dates for the query. ```HTTP GET https://stats.figshare.com/breakdown/day/views/article/766364?start_date=2017-04-19&end_date=2017-04-21 ``` -------------------------------- ### Get Project Collaborators (JavaScript) Source: https://docs.figshare.com/index__gl=1%2Aehu6sc%2A_ga%2AMTAzMDIzODgwMy4xNzY5NTgzNTgz%2A_ga_CHDNWH4YDX%2AczE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw JavaScript example using the figshare_api npm package to retrieve project collaborators. Includes authentication setup and callback handling. ```javascript var FigshareApi = require('figshare_api'); var defaultClient = FigshareApi.ApiClient.instance; // Configure OAuth2 access token for authorization: OAuth2 var OAuth2 = defaultClient.authentications['OAuth2']; OAuth2.accessToken = "YOUR ACCESS TOKEN" var api = new FigshareApi.ProjectsApi() var projectId = 789; // {Long} Project unique identifier var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.privateProjectCollaboratorsList(projectId, , callback); ``` -------------------------------- ### Figshare API Client Setup (Perl) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This Perl snippet shows the initial setup for using the Figshare API client. It imports necessary modules for configuration and API access, preparing for subsequent API calls. ```perl use Data::Dumper; use WWW::SwaggerClient::Configuration; use WWW::SwaggerClient::ProjectsApi; ``` -------------------------------- ### Example Output for Empty Account Source: https://docs.figshare.com/?_gl=1%2Aehu6sc%2A_ga%2AMTAzMDIzODgwMy4xNzY5NTgzNTgz%2A_ga_CHDNWH4YDX%2AczE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw Illustrates the expected console output when running the script on an account that has no existing articles. ```text Listing current articles: No articles. ``` -------------------------------- ### Example Output for No Articles Source: https://docs.figshare.com/?_gl=1*ehu6sc*_ga*MTAzMDIzODgwMy4xNzY5NTgzNTgz*_ga_CHDNWH4YDX*czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw#!/oauth/get_token_info This is an example of how the script would output on an account with no added articles or files yet. ```text Listing current articles: No articles. ``` -------------------------------- ### Get Institution Accounts (Java) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info Java example demonstrating how to use the Figshare API client to fetch institution accounts. It includes authentication setup using OAuth2 and parameter configuration for filtering and pagination. ```java import io.swagger.client.*; import io.swagger.client.auth.*; import io.swagger.client.model.*; import io.swagger.client.api.InstitutionsApi; import java.io.File; import java.util.*; public class InstitutionsApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); // Configure OAuth2 access token for authorization: OAuth2 OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); OAuth2.setAccessToken("YOUR ACCESS TOKEN"); InstitutionsApi apiInstance = new InstitutionsApi(); Long page = 789L; // Long | Page number. Used for pagination with page_size Long pageSize = 789L; // Long | The number of results included on a page. Used for pagination with page Long limit = 789L; // Long | Number of results included on a page. Used for pagination with query Long offset = 789L; // Long | Where to start the listing (the offset of the first result). Used for pagination with limit Long isActive = 789L; // Long | Filter by active status String institutionUserId = "institutionUserId_example"; // String | Filter by institution_user_id String email = "email_example"; // String | Filter by email Long idLte = 789L; // Long | Retrieve accounts with an ID lower or equal to the specified value Long idGte = 789L; // Long | Retrieve accounts with an ID greater or equal to the specified value try { List result = apiInstance.privateInstitutionAccountsList(page, pageSize, limit, offset, isActive, institutionUserId, email, idLte, idGte); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling InstitutionsApi#privateInstitutionAccountsList"); e.printStackTrace(); } } } ``` -------------------------------- ### Get Account Institution Details using Python Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info A Python example for interacting with the Figshare API to fetch institution data. This snippet requires the 'swagger_client' library and proper setup of your OAuth2 access token for authentication. ```python from __future__ import print_statement import time import swagger_client from swagger_client.rest import ApiException from pprint import pprint # Note: The actual call to privateInstitutionDetails is missing in the provided snippet. # A complete example would involve instantiating the API client and calling the method. # Example placeholder: # api_client = swagger_client.ApiClient() # api_client.configuration.access_token = 'YOUR ACCESS TOKEN' # institutions_api = swagger_client.InstitutionsApi(api_client) # try: # institutions = institutions_api.private_institution_details() # pprint(institutions) # except ApiException as e: # print("Exception when calling InstitutionsApi->private_institution_details: %s\n" % e) ``` -------------------------------- ### File Part Byte Range Example Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info Illustrates how byte ranges are defined for file parts using `startOffset` and `endOffset`. This example shows how a file is divided into parts based on these offsets. ```text Given: * the following file data: "abcdefghij" * `part1` with `startOffset=0` and `endOffset=3` * `part2` with `startOffset=4` and `endOffset=7` Then: * `part1` is `abcd` * `part2` is `efgh` ``` -------------------------------- ### Create Project Article using Python Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This Python example demonstrates creating a new article and associating it with a project via the Figshare API. It sets up the API client, configures the access token, and includes exception handling for API errors. Ensure the swagger_client library is installed. ```python from __future__ import print_statement import time import swagger_client from swagger_client.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: OAuth2 swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_instance = swagger_client.ProjectsApi() projectId = 789 # Long | Project unique identifier article = # ArticleProjectCreate | Article description try: # Create project article api_response = api_instance.private_project_articles_create(projectId, article) pprint(api_response) except ApiException as e: print("Exception when calling ProjectsApi->privateProjectArticlesCreate: %s\n" % e) ``` -------------------------------- ### Get Account Collections Articles - Java Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info Java example demonstrating how to list articles within a private collection using the Figshare API client. It includes OAuth2 authentication setup and parameter handling for pagination. ```java import io.swagger.client.*; import io.swagger.client.auth.*; import io.swagger.client.model.*; import io.swagger.client.api.CollectionsApi; import java.io.File; import java.util.*; public class CollectionsApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); // Configure OAuth2 access token for authorization: OAuth2 OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); OAuth2.setAccessToken("YOUR ACCESS TOKEN"); CollectionsApi apiInstance = new CollectionsApi(); Long collectionId = 789L; // Long | Collection unique identifier Long page = 789L; // Long | Page number. Used for pagination with page_size Long pageSize = 789L; // Long | The number of results included on a page. Used for pagination with page Long limit = 789L; // Long | Number of results included on a page. Used for pagination with query Long offset = 789L; // Long | Where to start the listing (the offset of the first result). Used for pagination with limit try { array[Article] result = apiInstance.privateCollectionArticlesList(collectionId, page, pageSize, limit, offset); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CollectionsApi#privateCollectionArticlesList"); e.printStackTrace(); } } } ``` ```java import io.swagger.client.api.CollectionsApi; public class CollectionsApiExample { public static void main(String[] args) { CollectionsApi apiInstance = new CollectionsApi(); Long collectionId = 789L; // Long | Collection unique identifier Long page = 789L; // Long | Page number. Used for pagination with page_size Long pageSize = 789L; // Long | The number of results included on a page. Used for pagination with page Long limit = 789L; // Long | Number of results included on a page. Used for pagination with query Long offset = 789L; // Long | Where to start the listing (the offset of the first result). Used for pagination with limit try { array[Article] result = apiInstance.privateCollectionArticlesList(collectionId, page, pageSize, limit, offset); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CollectionsApi#privateCollectionArticlesList"); e.printStackTrace(); } } } ``` -------------------------------- ### Get Article Embargo Details - PHP Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This PHP code example demonstrates how to fetch article embargo details using the Figshare API client. It shows the necessary setup for authentication and making the API request. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new SwaggerClientApiArticlesApi(); $articleId = 789; // Long | Article unique identifier try { $result = $api_instance->privateArticleEmbargoDetails($articleId); print_r($result); } catch (Exception $e) { echo 'Exception when calling ArticlesApi->privateArticleEmbargoDetails: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Create Project Note using C# Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This C# example demonstrates how to create a note for a project using the Figshare API client. It covers OAuth2 authentication configuration and error handling. ```csharp using System; using System.Diagnostics; using IO.Swagger.Api; using IO.Swagger.Client; using IO.Swagger.Model; namespace Example { public class privateProjectNotesCreateExample { public void main() { // Configure OAuth2 access token for authorization: OAuth2 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new ProjectsApi(); var projectId = 789L; // Long | Project unique identifier var note = new ProjectNoteCreate(); // ProjectNoteCreate | Note message try { // Create project note Location result = apiInstance.privateProjectNotesCreate(projectId, note); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling ProjectsApi.privateProjectNotesCreate: " + e.Message ); } } } } ``` -------------------------------- ### Create Project Article Request Example Source: https://docs.figshare.com/index Example of a POST request to create a new article within a project. It demonstrates how to populate the various fields including title, description, authors, and custom fields. ```http POST /v1/projects/{project_id}/articles { "title": "My Awesome Article", "description": "This is a detailed description of my article.", "authors": [ { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com" } ], "custom_fields": { "my_custom_field": "some_value" } } ``` -------------------------------- ### Get Account Institution Details using Objective-C Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This example illustrates how to retrieve institution details using Objective-C with the Figshare API. It requires the Swagger client library and proper OAuth2 authentication setup with your access token. ```objective-c Configuration *apiConfig = [Configuration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: OAuth2) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; InstitutionsApi *apiInstance = [[InstitutionsApi alloc] init]; // Private Account Institutions [apiInstance privateInstitutionDetailsWithCompletionHandler: ^(Institution output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }]; ``` -------------------------------- ### POST Institution Curation Review Comment (JavaScript) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info JavaScript example using the Figshare API client to post a comment on an institution review. It covers authentication setup and the API call. Ensure the 'figshare_api' npm package is installed. ```javascript var FigshareApi = require('figshare_api'); var defaultClient = FigshareApi.ApiClient.instance; // Configure OAuth2 access token for authorization: OAuth2 var OAuth2 = defaultClient.authentications['OAuth2']; OAuth2.accessToken = "YOUR ACCESS TOKEN" var api = new FigshareApi.InstitutionsApi() var curationId = 789; // {Long} ID of the curation var curationComment = null; // {CurationCommentCreate} The content/value of the comment. var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully.'); } }; api.postAccountInstitutionCurationComments(curationId, curationComment, callback); ``` -------------------------------- ### Create Project Note using Objective-C Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This Objective-C example demonstrates how to create a note for a project using the Figshare API client. It covers OAuth2 token configuration and asynchronous API calls. ```objectivec Configuration *apiConfig = [Configuration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: OAuth2) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; NSNumber *projectId = @789; // Project unique identifier ProjectNoteCreate *note = [[ProjectNoteCreate alloc] init]; // Note message ProjectsApi *apiInstance = [[ProjectsApi alloc] init]; // Create project note [apiInstance privateProjectNotesCreateWith:projectId note:note completionHandler: ^(Location output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }]; ``` -------------------------------- ### Create Project Note using PHP Source: https://docs.figshare.com/index__gl=1%2Aehu6sc%2A_ga%2AMTAzMDIzODgwMy4xNzY5NTgzNTgz%2A_ga_CHDNWH4YDX%2AczE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw This PHP example demonstrates how to create a project note using the Figshare API. It includes setting up the API configuration with an access token and making the API call to create the note. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new Swagger\Client\Api\ProjectsApi(); $projectId = 789; // Long | Project unique identifier $note = null; // ProjectNoteCreate | Note message try { $result = $api_instance->privateProjectNotesCreate($projectId, $note); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProjectsApi->privateProjectNotesCreate: ', $e->getMessage(), "\n"; } ``` -------------------------------- ### Create Project Note using Python Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This Python example demonstrates how to create a note for a project using the Figshare API client. It covers authentication and making the API call to create a project note. ```python from __future__ import print_function import time import swagger_client from swagger_client.rest import ApiException from pprint import pprint # create an instance of the API class api_client = swagger_client.ApiClient() api_client.configuration.access_token = 'YOUR ACCESS TOKEN' api = swagger_client.ProjectsApi(api_client) projectId = 789 # Long | Project unique identifier note = swagger_client.ProjectNoteCreate() # ProjectNoteCreate | Note message try: # Create project note api_response = api.private_project_notes_create(projectId, note) pprint(api_response) except ApiException as e: print("Exception when calling ProjectsApi->private_project_notes_create: %s\n" % e) ``` -------------------------------- ### Create Project Note using PHP Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This PHP example shows how to create a note for a project using the Figshare API client library. It includes setting the OAuth2 access token and handling potential exceptions. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new Swagger\Client\Api\ProjectsApi(); $projectId = 789; // Long | Project unique identifier $note = new Swagger\Client\Model\ProjectNoteCreate(); // ProjectNoteCreate | Note message try { $result = $api_instance->privateProjectNotesCreate($projectId, $note); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProjectsApi->privateProjectNotesCreate: ', $e->getMessage(), "\n"; } ``` -------------------------------- ### Get Project Articles using JavaScript Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This JavaScript example shows how to retrieve project articles using the Figshare API client library. It covers authentication setup with an OAuth2 access token and making the API call with a callback function for handling responses. ```javascript var FigshareApi = require('figshare_api'); var defaultClient = FigshareApi.ApiClient.instance; // Configure OAuth2 access token for authorization: OAuth2 var OAuth2 = defaultClient.authentications['OAuth2']; OAuth2.accessToken = "YOUR ACCESS TOKEN" var api = new FigshareApi.ProjectsApi() var projectId = 789; // {Long} Project unique identifier var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.privateProjectArticlesList(projectId, callback); ``` -------------------------------- ### Create Project Note using Java Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This Java example shows how to create a note for a project using the Figshare API client library. It includes configuration for OAuth2 authentication and making the API call. ```java import io.swagger.client.*; import io.swagger.client.auth.*; import io.swagger.client.model.*; import io.swagger.client.api.ProjectsApi; import java.io.File; import java.util.*; public class ProjectsApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); // Configure OAuth2 access token for authorization: OAuth2 OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); OAuth2.setAccessToken("YOUR ACCESS TOKEN"); ProjectsApi apiInstance = new ProjectsApi(); Long projectId = 789L; // Long | Project unique identifier ProjectNoteCreate note = new ProjectNoteCreate(); // ProjectNoteCreate | Note message try { Location result = apiInstance.privateProjectNotesCreate(projectId, note); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ProjectsApi#privateProjectNotesCreate"); e.printStackTrace(); } } } ``` ```java import io.swagger.client.api.ProjectsApi; public class ProjectsApiExample { public static void main(String[] args) { ProjectsApi apiInstance = new ProjectsApi(); Long projectId = 789L; // Long | Project unique identifier ProjectNoteCreate note = new ProjectNoteCreate(); // ProjectNoteCreate | Note message try { Location result = apiInstance.privateProjectNotesCreate(projectId, note); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ProjectsApi#privateProjectNotesCreate"); e.printStackTrace(); } } } ``` -------------------------------- ### Create Project Note using PHP Source: https://docs.figshare.com/index This PHP example demonstrates how to create a project note using the Figshare API. It includes setting up the API client, configuring OAuth2 authentication, and making the API call. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new Swagger\Client\Api\ProjectsApi(); $projectId = 789; // Long | Project unique identifier $note = null; // ProjectNoteCreate | Note message try { $result = $api_instance->privateProjectNotesCreate($projectId, $note); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProjectsApi->privateProjectNotesCreate: ', $e->getMessage(), "\n"; } ``` -------------------------------- ### GET Impersonation Example Source: https://docs.figshare.com/?_gl=1*ehu6sc*_ga*MTAzMDIzODgwMy4xNzY5NTgzNTgz*_ga_CHDNWH4YDX*czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw#!/oauth/get_token_info Use the `impersonate` option in the query string for GET requests to access resources as another account. ```http GET /v2/account/articles?impersonate=1000009 HTTP/1.1 ``` -------------------------------- ### Get Collection Private Link Details (PHP) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This PHP snippet shows the initial setup for calling the Figshare API to get private link details. It includes requiring the autoload file and configuring the OAuth2 access token. Further API calls would follow this setup. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new SwaggerClientApiCollectionsApi(); ``` -------------------------------- ### Execute Main Function Source: https://docs.figshare.com/?_gl=1*ehu6sc*_ga*MTAzMDIzODgwMy4xNzY5NTgzNTgz*_ga_CHDNWH4YDX*czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw#!/oauth/get_token_info This snippet shows the standard Python entry point for executing the main function. ```python if __name__ == "__main__": main() ``` -------------------------------- ### GET Request without Authentication (Shell) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info Example of making a GET request to an endpoint that does not require authentication. This is used for retrieving statistics outside of an institutional scope. ```shell GET https://stats.figshare.com/top/views/article ``` -------------------------------- ### Get Project Articles using C# Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This C# code example illustrates how to fetch project articles using the Figshare API client. It demonstrates initializing the ProjectsApi client, setting the project ID and optional pagination parameters, and handling the results or exceptions. ```csharp using System; using System.Diagnostics; using IO.Swagger.Api; using IO.Swagger.Client; using IO.Swagger.Model; namespace Example { public class projectArticlesExample { public void main() { var apiInstance = new ProjectsApi(); var projectId = 789L; // Long | Project Unique identifier var page = 789L; // Long | Page number. Used for pagination with page_size (optional) var pageSize = 789L; // Long | The number of results included on a page. Used for pagination with page (optional) (default to 10) var limit = 789L; // Long | Number of results included on a page. Used for pagination with query (optional) var offset = 789L; // Long | Where to start the listing (the offset of the first result). Used for pagination with limit (optional) try { // method is not fully implemented in the example, please check the implementation in the client library // var result = apiInstance.ProjectArticles(projectId, page, pageSize, limit, offset); // Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling ProjectsApi.ProjectArticles: " + e.Message ); } } } } ``` -------------------------------- ### Sending Parameters - Query String Example Source: https://docs.figshare.com/?_gl=1*ehu6sc*_ga*MTAzMDIzODgwMy4xNzY5NTgzNTgz*_ga_CHDNWH4YDX*czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw#!/oauth/get_token_info Shows how to send parameters in the query string for GET requests, using the 'page' parameter as an example for listing articles. ```APIDOC ## Sending Parameters - Query String ### Description This example illustrates sending parameters in the query string, which is common for `GET` requests. Here, the `page` parameter is used to retrieve a specific page of articles. ### Method GET ### Endpoint /v2/articles?page={page_number} ### Parameters #### Query Parameters - **page** (int) - Optional - The page number to retrieve. Defaults to 1. ### Request Example ```http GET /v2/articles?page=3 HTTP/1.1 Host: api.figshare.com Authorization: token a287ab8c7ebdbe6 ``` ``` -------------------------------- ### Create Project Note using C# Source: https://docs.figshare.com/index__gl=1%2Aehu6sc%2A_ga%2AMTAzMDIzODgwMy4xNzY5NTgzNTgz%2A_ga_CHDNWH4YDX%2AczE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw This C# example shows how to create a project note using the Figshare API. It covers configuring the API client with an access token and handling potential exceptions during the API call. ```csharp using System; using System.Diagnostics; using IO.Swagger.Api; using IO.Swagger.Client; using IO.Swagger.Model; namespace Example { public class privateProjectNotesCreateExample { public void main() { // Configure OAuth2 access token for authorization: OAuth2 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new ProjectsApi(); var projectId = 789L; // Long | Project unique identifier var note = new ProjectNoteCreate(); // ProjectNoteCreate | Note message try { // Create project note Location result = apiInstance.privateProjectNotesCreate(projectId, note); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling ProjectsApi.privateProjectNotesCreate: " + e.Message ); } } } } ``` -------------------------------- ### Get Institution Articles (cURL) Source: https://docs.figshare.com/index__gl=1%2Aehu6sc%2A_ga%2AMTAzMDIzODgwMy4xNzY5NTgzNTgz%2A_ga_CHDNWH4YDX%2AczE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw Example using cURL to make a GET request to the Figshare API to retrieve articles for an institution. This command can be executed directly from the terminal. ```curl curl -X GET "https://api.figshare.com/v2/account/institution/articles?page=&page_size=&limit=&offset=&order=&order_direction=&published_since=&modified_since=&status=&resource_doi=&item_type=&group=" ``` -------------------------------- ### Initialize Figshare API Client (Python) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This Python snippet shows the initial setup for using the Figshare API client. It includes configuring the OAuth2 access token and importing necessary modules for API interaction. This is a prerequisite for making calls to the API. ```python from __future__ import print_statement import time import swagger_client from swagger_client.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: OAuth2 swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' ``` -------------------------------- ### Initiate Private Article Upload (C#) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info Demonstrates initiating a private article upload using the C# SDK. This example configures the OAuth2 access token and calls the `privateArticleUploadInitiate` method on the `ArticlesApi` instance. It includes error handling for exceptions. ```csharp using System; using System.Diagnostics; using IO.Swagger.Api; using IO.Swagger.Client; using IO.Swagger.Model; namespace Example { public class privateArticleUploadInitiateExample { public void main() { // Configure OAuth2 access token for authorization: OAuth2 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new ArticlesApi(); var articleId = 789; // Long | Article unique identifier var file = new FileCreator(); // FileCreator | var page = 789; // Long | Page number. Used for pagination with page_size (optional) var pageSize = 789; // Long | The number of results included on a page. Used for pagination with page (optional) (default to 10) var limit = 789; // Long | Number of results included on a page. Used for pagination with query (optional) var offset = 789; // Long | Where to start the listing (the offset of the first result). Used for pagination with limit (optional) try { // Initiate Upload Location result = apiInstance.privateArticleUploadInitiate(articleId, file, page, pageSize, limit, offset); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling ArticlesApi.privateArticleUploadInitiate: " + e.Message ); } } } } ``` -------------------------------- ### Get Institution Review (Curl) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info Example using Curl to make a GET request to the /account/institution/review/{curation_id} endpoint. This is a simple command-line method for testing API calls. ```curl curl -X GET "https://api.figshare.com/v2/account/institution/review/{curation_id}" ``` -------------------------------- ### Example Script Output Source: https://docs.figshare.com/?_gl=1*ehu6sc*_ga*MTAzMDIzODgwMy4xNzY5NTgzNTgz*_ga_CHDNWH4YDX*czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw#!/oauth/get_token_info This shows the expected output when running the upload script on an account with no existing articles or files. ```text Listing current articles: No articles. Created article: https://api.figshare.com/v2/account/articles/2012182 Listing current articles: https://api.figshare.com/v2/articles/2012182 - A 3D cat object model Listing files for article 2012182: No files. Initiated file upload: https://api.figshare.com/v2/account/articles/2012182/files/3008150 Uploading parts: Uploaded part 1 from 0 to 213325 Listing files for article 2012182: 3008150 - cat.obj ``` -------------------------------- ### Curl HR Feed Example Source: https://docs.figshare.com/swagger.json Example of how to access the HR Feed private endpoint using Curl. This demonstrates the basic HTTP GET request with an authorization token. ```bash curl -H "Authorization: Token YOUR_API_TOKEN" https://api.figshare.com/v2/hr/articles ``` -------------------------------- ### Create Project Note using JavaScript Source: https://docs.figshare.com/index__gl=1%2Aehu6sc%2A_ga%2AMTAzMDIzODgwMy4xNzY5NTgzNTgz%2A_ga_CHDNWH4YDX%2AczE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw This JavaScript example demonstrates creating a project note via the Figshare API. It includes setting up the API client, configuring the OAuth2 access token, and calling the function to create the note. ```javascript var FigshareApi = require('figshare_api'); var defaultClient = FigshareApi.ApiClient.instance; // Configure OAuth2 access token for authorization: OAuth2 var OAuth2 = defaultClient.authentications['OAuth2']; OAuth2.accessToken = "YOUR ACCESS TOKEN" var api = new FigshareApi.ProjectsApi() var projectId = 789; // {Long} Project unique identifier var note = null; // {ProjectNoteCreate} Note message var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.privateProjectNotesCreate(projectId, note, callback); ``` -------------------------------- ### Get Collection Versions using Python Source: https://docs.figshare.com/index This Python example utilizes the `swagger_client` library to get collection versions. It includes error handling for `ApiException` and pretty-prints the API response. ```python from __future__ import print_statement import time import swagger_client from swagger_client.rest import ApiException from pprint import pprint # create an instance of the API class api_instance = swagger_client.CollectionsApi() collectionId = 789 # Long | Collection Unique identifier try: # Collection Versions list api_response = api_instance.collection_versions(collectionId) pprint(api_response) except ApiException as e: print("Exception when calling CollectionsApi->collectionVersions: %s\n" % e) ``` -------------------------------- ### GET Request with Basic Authentication (Shell) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info Example of making a GET request to a specialized endpoint requiring Basic Authentication. This involves encoding the username and password in the Authorization header. ```shell GET https://stats.figshare.com/lboro/top/views/article Authorization: Basic dGhpcyBpcyBub3QgdGhlIHJlYWwgcGFzc3dvcmQsIGZvb2wh ``` -------------------------------- ### Get Project Collaborators (Java) Source: https://docs.figshare.com/index__gl=1%2Aehu6sc%2A_ga%2AMTAzMDIzODgwMy4xNzY5NTgzNTgz%2A_ga_CHDNWH4YDX%2AczE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw Java example demonstrating how to list collaborators for a project using the Swagger client library. It includes authentication configuration and error handling. ```java import io.swagger.client.*; import io.swagger.client.auth.*; import io.swagger.client.model.*; import io.swagger.client.api.ProjectsApi; import java.io.File; import java.util.*; public class ProjectsApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); // Configure OAuth2 access token for authorization: OAuth2 OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); OAuth2.setAccessToken("YOUR ACCESS TOKEN"); ProjectsApi apiInstance = new ProjectsApi(); Long projectId = 789; // Long | Project unique identifier try { array[ProjectCollaborator] result = apiInstance.privateProjectCollaboratorsList(projectId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ProjectsApi#privateProjectCollaboratorsList"); e.printStackTrace(); } } } ``` -------------------------------- ### List Project Notes - Python Example Source: https://docs.figshare.com/index__gl=1%2Aehu6sc%2A_ga%2AMTAzMDIzODgwMy4xNzY5NTgzNTgz%2A_ga_CHDNWH4YDX%2AczE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw Illustrates fetching project notes using the Python SDK for the Figshare API. This example shows how to set the access token, create an API client instance, and call the `private_project_notes_list` method, including error handling for API exceptions. ```python from __future__ import print_statement import time import swagger_client from swagger_client.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: OAuth2 swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_instance = swagger_client.ProjectsApi() projectId = 789 # Long | Project unique identifier page = 789 # Long | Page number. Used for pagination with page_size (optional) pageSize = 789 # Long | The number of results included on a page. Used for pagination with page (optional) (default to 10) limit = 789 # Long | Number of results included on a page. Used for pagination with query (optional) offset = 789 # Long | Where to start the listing (the offset of the first result). Used for pagination with limit (optional) try: # List project notes api_response = api_instance.private_project_notes_list(projectId, page=page, pageSize=pageSize, limit=limit, offset=offset) pprint(api_response) except ApiException as e: print("Exception when calling ProjectsApi->privateProjectNotesList: %s\n" % e) ``` -------------------------------- ### Get Project Note (C#) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info C# example for accessing the Figshare API to get project note details. It shows how to configure the API client and handle potential exceptions. ```csharp using System; using System.Diagnostics; using IO.Swagger.Api; using IO.Swagger.Client; using IO.Swagger.Model; namespace Example { public class privateProjectNoteExample { public void main() { // Configure OAuth2 access token for authorization: OAuth2 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new ProjectsApi(); var projectId = 789L; // Long | Project unique identifier var noteId = 789L; // Long | Note unique identifier try { // Project note details ProjectNotePrivate result = apiInstance.privateProjectNote(projectId, noteId); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling ProjectsApi.privateProjectNote: " + e.Message ); } } } } ``` -------------------------------- ### Create Project Note using JavaScript Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This JavaScript example shows how to create a note for a project using the Figshare API client library. It includes setting up the OAuth2 access token and making the API request. ```javascript var FigshareApi = require('figshare_api'); var defaultClient = FigshareApi.ApiClient.instance; // Configure OAuth2 access token for authorization: OAuth2 var OAuth2 = defaultClient.authentications['OAuth2']; OAuth2.accessToken = "YOUR ACCESS TOKEN" var api = new FigshareApi.ProjectsApi() var projectId = 789; // {Long} Project unique identifier var note = new FigshareApi.ProjectNoteCreate(); // {ProjectNoteCreate} Note message var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.privateProjectNotesCreate(projectId, note, callback); ``` -------------------------------- ### Get Article Authors via Curl Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info Example using Curl to make a GET request to the Figshare API endpoint for retrieving article authors. This is a basic command-line approach. ```bash curl -X GET "https://api.figshare.com/v2/account/articles/{article_id}/authors" ``` -------------------------------- ### Get Project Notes (JavaScript) Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This JavaScript example demonstrates fetching project notes using the Figshare API client. It shows how to set up the OAuth2 access token and pass pagination options. The callback function handles the API response or any errors. ```javascript var FigshareApi = require('figshare_api'); var defaultClient = FigshareApi.ApiClient.instance; // Configure OAuth2 access token for authorization: OAuth2 var OAuth2 = defaultClient.authentications['OAuth2']; OAuth2.accessToken = "YOUR ACCESS TOKEN" var api = new FigshareApi.ProjectsApi() var projectId = 789; // {Long} Project unique identifier var opts = { 'page': 789, // {Long} Page number. Used for pagination with page_size 'pageSize': 789, // {Long} The number of results included on a page. Used for pagination with page 'limit': 789, // {Long} Number of results included on a page. Used for pagination with query 'offset': 789 // {Long} Where to start the listing (the offset of the first result). Used for pagination with limit }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.privateProjectNotesList(projectId, opts, callback); ``` -------------------------------- ### Get Token Info via Curl (HTTP Header) Source: https://docs.figshare.com/?_gl=1*ehu6sc*_ga*MTAzMDIzODgwMy4xNzY5NTgzNTgz*_ga_CHDNWH4YDX*czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw#!/oauth/get_token_info Example using curl to get token information with the authorization token in the header. Replace ACCESS_TOKEN with your actual token. ```curl curl -H "Authorization: token ACCESS_TOKEN" https://api.figshare.com/v2 ``` -------------------------------- ### Get Account Institution Reviews (Objective-C) Source: https://docs.figshare.com/index Shows how to retrieve institution reviews using the Objective-C client. This example covers setting up authentication and calling the API to get curation data. ```objc Configuration *apiConfig = [Configuration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: OAuth2) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; NSNumber *groupId = @789; // Filter by the group ID (optional) NSNumber *articleId = @789; // Retrieve the reviews for this article (optional) NSString *status = @"status_example"; // Filter by the status of the review (optional) NSNumber *limit = @789; // Number of results included on a page. Used for pagination with query (optional) NSNumber *offset = @789; // Where to start the listing (the offset of the first result). Used for pagination with limit (optional) InstitutionsApi *apiInstance = [[InstitutionsApi alloc] init]; // Institution Curation Reviews [apiInstance accountInstitutionCurationsWithGroupId:groupId articleId:articleId status:status limit:limit offset:offset completionHandler: ^(Curation output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }]; ``` -------------------------------- ### List Public Projects using C# Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info This C# example demonstrates how to list public projects using the Swagger-generated client library. It shows how to instantiate the ProjectsApi, set various optional parameters for filtering and pagination, and use a try-catch block to handle potential exceptions during the API call. ```csharp using System; using System.Diagnostics; using IO.Swagger.Api; using IO.Swagger.Client; using IO.Swagger.Model; namespace Example { public class projectsListExample { public void main() { var apiInstance = new ProjectsApi(); var xCursor = new UUID(); // UUID | Unique hash used for bypassing the item retrieval limit of 9,000 entities. When using this parameter, please note that the offset parameter will not be available, but the limit parameter will still work as expected. (optional) var page = 789; // Long | Page number. Used for pagination with page_size (optional) var pageSize = 789; // Long | The number of results included on a page. Used for pagination with page (optional) (default to 10) var limit = 789; // Long | Number of results included on a page. Used for pagination with query (optional) var offset = 789; // Long | Where to start the listing (the offset of the first result). Used for pagination with limit (optional) var order = order_example; // String | The field by which to order. Default varies by endpoint/resource. (optional) (default to published_date) var orderDirection = orderDirection_example; // String | (optional) (default to desc) var institution = 789; // Long | only return collections from this institution (optional) var publishedSince = publishedSince_example; // String | Filter by article publishing date. Will only return articles published after the date. date(ISO 8601) YYYY-MM-DD (optional) var group = 789; // Long | only return collections from this group (optional) try { // Public Projects array[Project] result = apiInstance.projectsList(xCursor, page, pageSize, limit, offset, order, orderDirection, institution, publishedSince, group); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling ProjectsApi.projectsList: " + e.Message ); } } } } ``` -------------------------------- ### List Project Articles - C# Source: https://docs.figshare.com/index__gl=1_ehu6sc__ga_MTAzMDIzODgwMy4xNzY5NTgzNTgz__ga_CHDNWH4YDX_czE3Njk1ODM1ODIkbzEkZzAkdDE3Njk1ODM2MDQkajYwJGwwJGgw_!/oauth/get_token_info C# example for retrieving project articles using the Figshare API. It demonstrates setting pagination parameters like limit and offset, and includes basic error handling. ```csharp var limit = 789; // Long | Number of results included on a page. Used for pagination with query (optional) var offset = 789; // Long | Where to start the listing (the offset of the first result). Used for pagination with limit (optional) try { // Public Project Articles array[Article] result = apiInstance.projectArticles(projectId, page, pageSize, limit, offset); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling ProjectsApi.projectArticles: " + e.Message ); } } } } ```