MySafe APIs
  • 9 minutes to read
  • Dark
    Light
  • PDF

MySafe APIs

  • Dark
    Light
  • PDF

Article Summary

Authorization of MySafe APIs is performed directly in the module. To learn more, see the MySafe API Integration article.


Get a password

Method: Get

GET /iso/mysafe/password/{id}

Parameters

FieldDescriptionRequired?
idSecret identification codeYes

Expected response on success

HTTP/1.1 200 OK


{
    "response": {
        "status": 200,
        "mensagem": "Success",
        "erro": false,
        "cod_erro": 0,
        "message": "Success",
        "error": false,
        "error_code": 0
    },
    "password_entity": {
            "identifier": "1",
            "name": "url",
            "url": "www.url.com",
            "username": "matheus",
            "password": "%#BRasil123",
            "notes": "",
            "tags": ""
    }
}

Expected response in case of error - user has no access, or the secret doesn't exist

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1005: Password not found",
        "erro": true,
        "cod_erro": 0,
        "message": "1005: Password not found",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1005,
        "message": "1005: Password not found",
        "detail": ""
    }
}

Expected response in case of error - inactive information

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1005: Password not found",
        "erro": true,
        "cod_erro": 0,
        "message": "1005: Password not found",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1005,
        "message": "1005: Password not found",
        "detail": ""
    }
}

Get a note

Method: Get

GET /iso/mysafe/note/{id}

Parameters

FieldDescriptionRequired?
idSecret identification codeYes

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "Success",
        "erro": false,
        "cod_erro": 0,
        "message": "Success",
        "error": false,
        "error_code": 0
    },
    "note_entity": {
            "identifier": "1",
            "name": "instagram.com\/matheus",
            "note": "matheus",
            "tags": ""
    }
}

Expected response in case of error - user has no access, or the secret doesn't exist

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1005: Note not found",
        "erro": true,
        "cod_erro": 0,
        "message": "1005: Note not found",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1005,
        "message": "1005: Note not found",
        "detail": ""
    }
}

Expected response in case of error - inactive information

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1009: Inactive note",
        "erro": true,
        "cod_erro": 0,
        "message": "1009: Inactive note",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1009,
        "message": "1009: Inactive note",
        "detail": ""
    }
}

Get all the passwords

Method: Get

GET /iso/mysafe/password?tag={tag}

Parameters

FieldDescriptionRequired?
tagSearches for all the passwords with a specific tag
No

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "",
        "erro": false,
        "cod_erro": 0,
        "message": "",
        "error": false,
        "error_code": 0
    },
    "password_on_list": [
        {
            "identifier": "1",
            "name": "url",
            "url": "www.url.com",
            "username": "matheus",
            "tags": "",
            "need_justify": "0",
            "need_approval": "0"
        },
        {
            "identifier": "12",
            "name": "repositorio",
            "url": "www.repositorio.com",
            "username": "shinobu",
            "tags": "",
            "need_justify": "0",
            "need_approval": "0"
        }
    ],
    "notes_on_list": [
        {
            "identifier": "1",
            "name": "marketing plan",
            "note": "update it before Jan/2023",
            "tags": "",
            "need_justify": "0",
            "need_approval": "0"
        }
    ]
}

Get all the notes

Method: Get

GET /iso/mysafe/note?tag={tag}

Parameters

FieldDescriptionRequired?
tagSearches for all the notes with a specific tag
No

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "",
        "erro": false,
        "cod_erro": 0,
        "message": "",
        "error": false,
        "error_code": 0
    },
    "notes_on_list": [
        {
            "identifier": "1",
            "name": "marketing plan",
            "tags": "",
            "need_justify": "0",
            "need_approval": "0"
        }
    ]
}

Create a password

At the time of creation, the information is automatically associated with the creator, identifying them as the owner.

Method: Post

POST /iso/mysafe/password

Parameters

FieldDescriptionRequired?
name
Yes
url
No
username
Yes
password
No
tags
No
users_allowed

Username of the users who will access the information and their permissions. The permission field is not mandatory. If it is blank, users will only have viewing permission.

No
groups_allowed

Name of the groups that will access the information and their permissions. The permission field is not mandatory. If it is blank, users will only have viewing permission.

No

Example request

{
    "name": "novainfo",
    "url", "",
    "username": "teste",
    "password": "123456",
    "tags": "tag1, tag2",
    "users_allowed": [
        {
            "username" : "Admin"
            "can_edit" : true
        },
        {
            "username" : "malu",
            "can_edit" : true
        }

    ],
    "groups_allowed": [
        {
            "name" : "grupo1",
            "can_edit" : true
        },
        {
            "name" : "grupo2",
            "can_edit" : true
        },
        {
            "name" : "grupo3",
            "can_edit" : true
        }
    ]
}

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 201,
        "mensagem": "Password successfully registered!",
        "erro": false,
        "cod_erro": 0,
        "message": "Password successfully registered!",
        "error": false,
        "error_code": 0
    },
    "password_entity": {
        "identifier": "176",
        "name": "novainfo",
        "url": "",
        "username": "teste",
        "note": "",
        "tags": "tag1, tag2"
    }
}

Expected response in case of error - to inform which fields were filled in incorrectly

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1001: Parameter 'username' was not informed!",
        "erro": true,
        "cod_erro": 0,
        "message": "1001: Parameter 'username' was not informed!",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1001,
        "message": "1001: Parameter 'username' was not informed!",
        "detail": ""
    }
}

Create a note

At the time of creation, the information is automatically associated with the creator of the authorization as its owner.

Method: Post

POST /iso/mysafe/note

Parameters

FieldDescriptionRequired?
name
Yes
note
Yes
tags
No
users_allowed

Username of the users who will access the information and their permissions. The permission field is not mandatory. If it is blank, users will only have viewing permission.

No
groups_allowed

Name of the groups that will access the information and their permissions. The permission field is not mandatory. If it is blank, users will only have viewing permission.

No

Example request

{
    "name": "nota",
    "note": "umanota",
    "users_allowed": [
        {
            "username" : "Admin",
            "can_edit" : true
        },
        {
            "username" : "malu",
            "can_edit" : true
        }
    ],
    "groups_allowed": [
        {
            "name" : "grupo1",
            "can_edit" : true
        },
        {
            "name" : "grupo2",
            "can_edit" : true
        }
    ]
}

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 201,
        "mensagem": "Note successfully registered!",
        "erro": false,
        "cod_erro": 0,
        "message": "Note successfully registered!",
        "error": false,
        "error_code": 0
    },
    "note_entity": {
        "identifier": "32",
        "name": "nota",
        "tags": ""
    }
}

Expected response in case of error - to inform which fields were filled in incorrectly

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1001: Parameter 'note' was not informed!",
        "erro": true,
        "cod_erro": 0,
        "message": "1001: Parameter 'note' was not informed!",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1001,
        "message": "1001: Parameter 'note' was not informed!",
        "detail": ""
    }
}

Deactivate a password

Method: Post

POST /iso/mysafe/password/inactive/{id}

Parameters

FieldDescriptionRequired?
id

Secret identification code

Yes

Expected response on success

HTTP/1.1 200 OK 
{
    "response": {
        "status": 200,
        "mensagem": "Password successfully deactivated",
        "erro": false,
        "cod_erro": 0,
        "message": "Password successfully deactivated",
        "error": false,
        "error_code": 0
    }
}

Expected response in case of error - permission denied

HTTP/1.1 403 Forbidden
{
    "response": {
        "status": 400,
        "mensagem": "1006: User does not have access",
        "erro": true,
        "cod_erro": 0,
        "message": "1006: User does not have access",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1006,
        "message": "1006: User does not have access",
        "detail": ""
    }
}

Expected response in case of error - information not found

HTTP/1.1 400 Bad Request 
{
    "response": {
        "status": 400,
        "mensagem": "1005: Password not found",
        "erro": true,
        "cod_erro": 0,
        "message": "1005: Password not found",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1005,
        "message": "1005: Password not found",
        "detail": ""
    }
}

Deactivate a note

Method: Post

POST /iso/mysafe/note/inactive/{id}

Parameters

FieldDescriptionRequired?
idSecret identification codeYes

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "Note successfully deactivated",
        "erro": false,
        "cod_erro": 0,
        "message": "Note successfully deactivated",
        "error": false,
        "error_code": 0
    }
}

Expected response in case of error - permission denied

HTTP/1.1 403 Forbidden
{
    "response": {
        "status": 400,
        "mensagem": "1006: User does not have access",
        "erro": true,
        "cod_erro": 0,
        "message": "1006: User does not have access",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1006,
        "message": "1006: User does not have access",
        "detail": ""
    }
}

Expected response in case of error - information not found

HTTP/1.1 400 Bad Request 
{
    "response": {
        "status": 400,
        "mensagem": "1005: Note not found",
        "erro": true,
        "cod_erro": 0,
        "message": "1005: Note not found",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1005,
        "message": "1005: Note not found",
        "detail": ""
    }
}



Reactivate a password

Method: Post

POST /iso/mysafe/password/active/{id}

Parameters

FieldDescriptionRequired?
IdSecret identification codeYes

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "Password successfully activated",
        "erro": false,
        "cod_erro": 0,
        "message": "Password successfully activated",
        "error": false,
        "error_code": 0
    }
}

Expected response in case of error - permission denied

HTTP/1.1 403 Forbidden
{
    "response": {
        "status": 400,
        "mensagem": "1006: User does not have access",
        "erro": true,
        "cod_erro": 0,
        "message": "1006: User does not have access",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1006,
        "message": "1006: User does not have access",
        "detail": ""
    }
}

Expected response in case of error - secret not found

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1005: Password not found",
        "erro": true,
        "cod_erro": 0,
        "message": "1005: Password not found",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1005,
        "message": "1005: Password not found",
        "detail": ""
    }
}

Reactivate a note

Method: Post

POST /iso/mysafe/note/active/{id}

Parameters

FieldDescriptionRequired?
idSecret identification code
Yes

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "Note successfully activated",
        "erro": false,
        "cod_erro": 0,
        "message": "Note successfully activated",
        "error": false,
        "error_code": 0
    }
}

Expected response in case of error - permission denied

HTTP/1.1 403 Forbidden
{
    "response": {
        "status": 400,
        "mensagem": "1006: User does not have access",
        "erro": true,
        "cod_erro": 0,
        "message": "1006: User does not have access",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1006,
        "message": "1006: User does not have access",
        "detail": ""
    }
}

Expected response in case of error - information not found

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1005: Note not found",
        "erro": true,
        "cod_erro": 0,
        "message": "1005: Note not found",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1005,
        "message": "1005: Note not found",
        "detail": ""
    }
}

Update a password

Method: Put

PUT /iso/mysafe/password/update/{id}

Parameters

FieldDescriptionRequired?
id

Secret identification code

Yes
name
Yes
url
No
username
No
password
No
tags
No
users_allowedUsername of the users who will access the information and their permissions. The permission field is not mandatory. If it is blank, users will only have viewing permission.
No

groups_allowed



Username of the users who will access the information and their permissions. The permission field is not mandatory. If it is blank, users will only have viewing permission.
No

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "Password successfully updated",
        "erro": false,
        "cod_erro": 0,
        "message": "Password successfully updated",
        "error": false,
        "error_code": 0
    }
}

Expected response in case of error - permission denied

HTTP/1.1 403 Forbidden
{
    "response": {
        "status": 400,
        "mensagem": "1006: User does not have access",
        "erro": true,
        "cod_erro": 0,
        "message": "1006: User does not have access",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1006,
        "message": "1006: User does not have access",
        "detail": ""
    }
}

Expected response in case of error - secret not found

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1005: Password not found",
        "erro": true,
        "cod_erro": 0,
        "message": "1005: Password not found",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1005,
        "message": "1005: Password not found",
        "detail": ""
    }
}

Update a note

Method: Put

PUT /iso/mysafe/note/update/{id}

Parameters

FieldDescriptionRequired?
id

Secret identification code

Yes
name
No
note
No
password
No
tags
No
users_allowedUsername of the users who will access the information and their permissions. The permission field is not mandatory. If it is blank, users will only have viewing permission.
No

groups_allowed


Name of the groups that will access the information and their permissions. The permission field is not mandatory. If it is blank, users will only have viewing permission.
No

Expected response on success

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "Note successfully updated",
        "erro": false,
        "cod_erro": 0,
        "message": "Note successfully updated",
        "error": false,
        "error_code": 0
    }
}

Expected response in case of error - permission denied

HTTP/1.1 403 Forbidden
{
    "response": {
        "status": 400,
        "mensagem": "1006: User does not have access",
        "erro": true,
        "cod_erro": 0,
        "message": "1006: User does not have access",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1006,
        "message": "1006: User does not have access",
        "detail": ""
    }
}

Expected response in case of error - secret not found

HTTP/1.1 400 Bad Request
{
    "response": {
        "status": 400,
        "mensagem": "1005: Note not found",
        "erro": true,
        "cod_erro": 0,
        "message": "1005: Note not found",
        "error": true,
        "error_code": 0
    },
    "exception": {
        "code": 1005,
        "message": "1005: Note not found",
        "detail": ""
    }
}

Was this article helpful?