Skip to content

Latest commit

 

History

History
368 lines (260 loc) · 9.28 KB

File metadata and controls

368 lines (260 loc) · 9.28 KB

RankVectors::ProjectsApi

All URIs are relative to https://api.rankvectors.com

Method HTTP request Description
create_project POST /api/projects Create a new project
delete_project DELETE /api/projects/{projectId} Delete a project
get_project GET /api/projects/{projectId} Get project details
list_projects GET /api/projects List all projects
sync_project POST /api/projects/{projectId}/sync Sync project

create_project

create_project(create_project_request)

Create a new project

Create a new project for internal linking optimization

Examples

require 'time'
require 'rankvectors'
# setup authorization
RankVectors.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = RankVectors::ProjectsApi.new
create_project_request = RankVectors::CreateProjectRequest.new({name: 'My Website', domain: 'https://example.com'}) # CreateProjectRequest | 

begin
  # Create a new project
  result = api_instance.create_project(create_project_request)
  p result
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->create_project: #{e}"
end

Using the create_project_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_project_with_http_info(create_project_request)

begin
  # Create a new project
  data, status_code, headers = api_instance.create_project_with_http_info(create_project_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Project>
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->create_project_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_project_request CreateProjectRequest

Return type

Project

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

delete_project

delete_project(project_id)

Delete a project

Delete a project and all associated data

Examples

require 'time'
require 'rankvectors'
# setup authorization
RankVectors.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = RankVectors::ProjectsApi.new
project_id = 'proj-123' # String | Unique identifier for the project

begin
  # Delete a project
  result = api_instance.delete_project(project_id)
  p result
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->delete_project: #{e}"
end

Using the delete_project_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> delete_project_with_http_info(project_id)

begin
  # Delete a project
  data, status_code, headers = api_instance.delete_project_with_http_info(project_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeleteProject200Response>
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->delete_project_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
project_id String Unique identifier for the project

Return type

DeleteProject200Response

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_project

get_project(project_id)

Get project details

Get detailed information about a specific project

Examples

require 'time'
require 'rankvectors'
# setup authorization
RankVectors.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = RankVectors::ProjectsApi.new
project_id = 'proj-123' # String | Unique identifier for the project

begin
  # Get project details
  result = api_instance.get_project(project_id)
  p result
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->get_project: #{e}"
end

Using the get_project_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_project_with_http_info(project_id)

begin
  # Get project details
  data, status_code, headers = api_instance.get_project_with_http_info(project_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Project>
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->get_project_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
project_id String Unique identifier for the project

Return type

Project

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_projects

<Array> list_projects

List all projects

Get a list of all projects for the authenticated user

Examples

require 'time'
require 'rankvectors'
# setup authorization
RankVectors.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = RankVectors::ProjectsApi.new

begin
  # List all projects
  result = api_instance.list_projects
  p result
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->list_projects: #{e}"
end

Using the list_projects_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(<Array>, Integer, Hash)> list_projects_with_http_info

begin
  # List all projects
  data, status_code, headers = api_instance.list_projects_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<Project>>
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->list_projects_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Array<Project>

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

sync_project

sync_project(project_id, opts)

Sync project

Trigger a full sync of project content (used by WordPress and other integrations)

Examples

require 'time'
require 'rankvectors'
# setup authorization
RankVectors.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = RankVectors::ProjectsApi.new
project_id = 'proj-123' # String | Unique identifier for the project
opts = {
  sync_project_request: RankVectors::SyncProjectRequest.new # SyncProjectRequest | 
}

begin
  # Sync project
  result = api_instance.sync_project(project_id, opts)
  p result
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->sync_project: #{e}"
end

Using the sync_project_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> sync_project_with_http_info(project_id, opts)

begin
  # Sync project
  data, status_code, headers = api_instance.sync_project_with_http_info(project_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SyncProject200Response>
rescue RankVectors::ApiError => e
  puts "Error when calling ProjectsApi->sync_project_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
project_id String Unique identifier for the project
sync_project_request SyncProjectRequest [optional]

Return type

SyncProject200Response

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json