Skip to main content

Logica API

Leandro Castro avatar
Written by Leandro Castro
Updated over a week ago

Overview

Use the Logica API to move data into and out of Logica.


API Setup

Contact Logica to schedule an onboarding session, and a specialist will walk through the API setup steps.


API Endpoints

/token

post:
tags:
- Authorization
summary: Get Token
description: >
This resource provides the access token required to access the other resources in this API. `NOTE: the base URL for this resource is: https://auth.api.logica.cloud/oauth2`
operationId: GetToken
parameters: []
requestBody:
content:
application/x-www-form-urlencoded:
encoding: {}
schema:
required:
- grant_type
type: object
properties:
grant_type:
type: string
example: client_credentials
required: false
responses:
200:
description: 'Access Token'
headers: {}
deprecated: false
servers:
- url: https://auth.api.logica.cloud/oauth2
description: Overrides the API base URL

/v1/models

get:
tags:
- Models
summary: Return a list of models related to the user associated with the API Key. This user could be the owner of the model or one of the user who share this model
operationId: Getmodels
responses:
'200':
description: 'OK'
content:
application/json:
schema:
$ref: '#/components/schemas/Models'
'401':
description: 'Invalid or expired token. Request a new token and try again'
headers: {}
'403':
description: 'Invalid client API Key'
headers: {}
'500':
description: 'Could not fetch the models due to a server error'
headers: {}
deprecated: false
security: []
servers:
- url: https://api.logica.cloud/models

/v1/models/{model_id}/nodes

get:
tags:
- Nodes
summary: Filter a list of nodes from a model based on the view name or based on the variable name (substring)
operationId: FilterNodes
parameters:
- name: model_id
in: path
description: 'Id of the model to get the values from'
required: true
schema:
type: string
example: 'xxxxxxxxxxxxxxxxxxxxxxxxx'
- name: x-api-key
in: header
description: 'Client specific API Key'
required: true
style: simple
schema:
type: string
example: xxxxxxxxxxxxxxxxx
- name: Authorization
in: header
description: 'Bearer token'
required: true
style: simple
schema:
type: string
example: Bearer {{accessToken}}
- name: name
in: query
description: 'Part or full name of a node. Required only if view_name is not informed'
required: true
schema:
type: string
example: '$ Rev'
- name: view_name
in: query
description: 'Name of a view. This field is required only if name parameter is not informed. It should return all the nodes in the informed view'
required: true
schema:
type: string
example: 'Actuals'
responses:
'200':
description: 'OK'
content:
application/json:
schema:
$ref: '#/components/schemas/nodes'
'400':
description: 'Bad Request - Check for missing required parameters'
headers: {}
'401':
description: 'Invalid or expired token. Request a new token and try again'
headers: {}
'403':
description: 'Invalid client API Key'
headers: {}
'500':
description: 'Could not fetch the values due to a server error'
headers: {}
deprecated: false
security: []
servers:
- url: https://api.logica.cloud/models/{model_id}
variables:
model_id:
default: xxxxxxxxxxxxxxxxxxxxxxxxx

put:
tags:
- Nodes
summary: Upsert nodes into a model
operationId: UpsertNodes
parameters:
- name: model_id
in: path
description: 'Id of the model to get the values from'
required: true
schema:
type: string
example: 'xxxxxxxxxxxxxxxxxxxxxxxxx'
- name: x-api-key
in: header
description: 'Client specific API Key'
required: true
style: simple
schema:
type: string
example: xxxxxxxxxxxxxxxxx
- name: Authorization
in: header
description: 'Bearer token'
required: true
style: simple
schema:
type: string
example: Bearer {{accessToken}}
requestBody:
description: 'Request payload'
content:
application/json:
schema:
$ref: '#/components/schemas/upsert_nodes_payload'
required: true
responses:
'200':
description: 'OK'
content:
application/json:
schema:
$ref: '#/components/schemas/nodes'
'400':
description: 'Bad Request - Check for missing required parameters'
headers: {}
'401':
description: 'Invalid or expired token. Request a new token and try again'
headers: {}
'403':
description: 'Invalid client API Key'
headers: {}
'500':
description: 'Could not fetch the values due to a server error'
headers: {}
deprecated: false
security: []
servers:
- url: https://api.logica.cloud/models/{model_id}
variables:
model_id:
default: xxxxxxxxxxxxxxxxxxxxxxxxx

/v1/models/{model_id}/values

post:
tags:
- Node values
summary: Return node values from a scenario, based on list of nodes in the request payload
operationId: Getnodevalues
parameters:
- name: model_id
in: path
description: 'Id of the model to get the values from'
required: true
schema:
type: string
example: 'xxxxxxxxxxxxxxxxxxxxxxxxx'
- name: x-api-key
in: header
description: 'Client specific API Key'
required: true
style: simple
schema:
type: string
example: xxxxxxxxxxxxxxxxx
- name: Authorization
in: header
description: 'Bearer token'
required: true
style: simple
schema:
type: string
example: Bearer {{accessToken}}
requestBody:
description: 'Request payload'
content:
application/json:
schema:
$ref: '#/components/schemas/get_values_payload'
example:
scenario: 1
month: 0
nodes:
- xxxxxxxxxxxxxxxx
- xxxxxxxxxxxxxxxx
required: true
responses:
'200':
description: 'OK'
content:
application/json:
schema:
$ref: '#/components/schemas/get_values_response'
'400':
description: |
There was a bad request, please check if your request has all the required fields and if its not requesting more than 50 nodes

Possible error messages:

Bad Request - Check for missing required parameters

Bad Request - The list of nodes must have a maximum of 50 items

Bad Request - At least one node should be informed"
headers: {}
'401':
description: 'Invalid of expired token. Request a new token and try again'
headers: {}
'403':
description: 'Invalid client API Key'
headers: {}
'500':
description: 'Could not fetch the values due to a server error'
headers: {}
deprecated: false
security: []
servers:
- url: https://api.logica.cloud/models/{model_id}
variables:
model_id:
default: xxxxxxxxxxxxxxxxxxxxxxxxx

put:
tags:
- Node values
summary: Update values in a list of nodes
operationId: Updatenodevalues
parameters:
- name: model_id
in: path
description: 'Id of the model that values will be updated'
required: true
schema:
type: string
- name: x-api-key
in: header
description: 'Client specific API Key'
required: true
style: simple
schema:
type: string
example: 'xxxxxxxxxxxxxxxxx'
- name: Authorization
in: header
description: 'Bearer token'
required: true
style: simple
schema:
type: string
example: Bearer {{accessToken}}
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/update_values_payload'
example:
scenario: 1
nodes:
- id: xxxxxxxxxxxx
values:
- month: 0
value: 2000
- month: 1
value: 1523
- month: 2
value: 2500
required: true
responses:
'200':
description: 'Values updated with success. Returns the same payload'
content:
application/json:
schema:
$ref: '#/components/schemas/update_values_payload'
'400':
description: |
There was a bad request, please check if your request has all the required fields and if its not requesting more than 50 nodes

Possible error messages:

Bad Request - Check for missing required parameters

Bad Request - The list of nodes must have a maximum of 50 items

Bad Request - At least one node should be informed"
headers: {}
'401':
description: 'Invalid or expired token. Request a new token and try again'
headers: {}
'403':
description: 'Invalid client API Key'
headers: {}
'500':
description: 'Could not update values due to a server error'
headers: {}
deprecated: false
security: []
servers:
- url: https://api.logica.cloud/models/{model_id}
variables:
model_id:
default: xxxxxxxxxxxxxxxxxxxxxxxxx

Did this answer your question?